Add customer to array

@param \Magento\Framework\DataObject|\Magento\Customer\Model\Customer $customer
@return $this
17476
public function addCategory(\Magento\Framework\DataObject $customer)
    {
        $email = strtolower(trim($customer->getEmail()));
        if (!isset($this->_customerIds[$email])) {
            $this->_customerIds[$email] = [];
        }
        $this->_customerIds[$email][$customer->getWebsiteId()] = $customer->getId();

        return $this;
    }
1303590
public function updateCustomer($customer_id)
    {
        $data = [
            "email" => request()->email,
            "first_name" => request()->fname,
            "last_name" => request()->lname,
            "phone" => request()->phone,
            "metadata" => request()->additional_info /* key => value pairs array */

        ];

        $this->setRequestOptions();
        return $this->setHttpResponse('/customer/'. $customer_id, 'PUT', $data)->getResponse();
    }
687419
public function getCustomer($customerId)
    {
        //retrieve customer, set customer attributes
        $customerModel = $this->customerResource->get($customerId);
        if ($customerModel instanceof \Exception) {
            throw $customerModel;
        }

        $this->_setAttributes($customerModel);
        $this->setDeletable(true);

        return $this;
    }
1076865
public function setCustomer(\Gpupo\CommonSchema\ORM\Entity\Trading\Order\Customer\Customer $customer = null)
    {
        $this->customer = $customer;

        return $this;
    }
278876
public function createFor(Customer $customer, array $options = [], array $filters = [])
    {
        return $this->createForId($customer->id, $options, $filters);
    }
802187
public function addOrder($source)
    {
        $orders   = $this->getOrders();
        $orders[] = $source;

        $this->setData('orders', $orders);

        return $this;
    }
272594
protected function udapteCustomerAttributes($customer)
    {
        try {
            $this->validator->validate($customer);

            $this->modelManager->persist($customer->getAttribute());
            $this->modelManager->flush($customer->getAttribute());
            $this->modelManager->refresh($customer->getAttribute());

            return $customer;
        } catch (Exception $ex) {
            return false;
        }
    }
623968
def create_customer(self, name, **kwargs):
        
        data = self._wrap_dict("customer", kwargs)
        data["customer"]["name"] = name
        return self.post("/customers.json", data=data)
393276
public function create()
    {
        /**
         * @var Customer $customer
         */
        $classNamespace = $this->getEntityNamespace();
        $customer = new $classNamespace();
        $customer
            ->setGender(ElcodiUserProperties::GENDER_UNKNOWN)
            ->setGuest(false)
            ->setNewsletter(false)
            ->setAddresses(new ArrayCollection())
            ->setCarts(new ArrayCollection())
            ->setOrders(new ArrayCollection())
            ->setToken($this->generator->generate(2))
            ->setEnabled(true)
            ->setCreatedAt($this->now());

        return $customer;
    }
436691
public function create(Customer &$customer)
    {
        $data = $customer->exportData();
        $endpoint = '/admin/customers.json';
        $response = $this->request(
            $endpoint, "POST", array(
            'customer' => $data
            )
        );
        $customer->setData($response['customer']);
    }
729509
public function addClient(\Gpupo\CommonSchema\ORM\Entity\Application\API\OAuth\Client\Client $client)
    {
        $this->clients[] = $client;

        return $this;
    }
1040198
public function createFor(Customer $customer, array $options = [], array $filters = [])
    {
        $this->parentId = $customer->id;

        return parent::rest_create($options, $filters);
    }
718807
private static function add_customer_header(&$data, &$customer_headers_array)
    {
        if (count($customer_headers_array) < 1) return;
	    foreach($customer_headers_array as $key=>$value)
	    {
            if(self::isCustomer_header($key))
	        { 
	            $data[$key] = $value;
            }
	    }
    }
1263236
public function addCustomerDetails()
    {
        $select = $this->getSelect()->joinInner(
            array('ce' => $this->getTable('customer/entity')),
            'ce.entity_id = main_table.customer_id',
            array('customer_email' => 'email')
        );

        $customer = Mage::getResourceSingleton('customer/customer');
        foreach (array_keys($this->_getNameFields()) as $field) {
            $adapter = $this->getConnection();
            $attr = $customer->getAttribute($field);

            $joinExpr = $field . '.entity_id = main_table.customer_id AND '
                . $adapter->quoteInto($field . '.entity_type_id = ?', $customer->getTypeId()) . ' AND '
                . $adapter->quoteInto($field . '.attribute_id = ?', $attr->getAttributeId());

            $select->joinLeft(
                array($field => $attr->getBackend()->getTable()),
                $joinExpr,
                array($field => 'value')
            );
        }

        return $this;
    }
712331
public function createCustomer($customerExtId)
    {
        $request = $this
            ->apiRequestFactory
            ->createCustomerRequest($customerExtId);

        return $this->send($request);
    }
592219
public function update($customer, $attributes = [])
    {
        $params = [
            'name'  => Arr::get($attributes, 'name'),
            'email' => Arr::get($attributes, 'email'),
        ];

        return $this->gateway->commit('put', $this->gateway->buildUrlFromString('customer/'.$customer), $params);
    }
563435
public function updateFromEmbeddedApiResponse(array $data): CustomerInterface
    {
        // we cast to int because for some reason Dandomain can (sometimes) have customers where the id is not set
        // and instead of setting the id to 0, Dandomain sets it to ''
        $id = (int) $data['id'];

        $customer = $this->customerRepository->findOneByExternalId($id);
        if (!$customer) {
            $customer = new Customer();
            $customer->setExternalId($id);
        }

        $customer
            ->setAddress($data['address'])
            ->setAddress2($data['address2'])
            ->setAttention($data['attention'])
            ->setCity($data['city'])
            ->setCountry($data['country'])
            ->setCountryId($data['countryId'])
            ->setEan($data['ean'])
            ->setEmail($data['email'])
            ->setFax($data['fax'])
            ->setName($data['name'])
            ->setPhone($data['phone'])
            ->setState($data['state'])
            ->setZipCode($data['zipCode'])
        ;

        return $customer;
    }