/** * @param OpenpayCustomerType $customerType * @return CustomerInterface */ protected function populate(OpenpayCustomerType $customerType) { $object = clone $this->object; $addressMapper = $this->addressMapper->create($customerType->getAddress()); $object->setEntityId($customerType->getId()); $object->setAddress($addressMapper); $object->setBalance($customerType->getBalance()); $object->setClabe($customerType->getClabe()); $object->setCreationDate($customerType->getCreationDate()); $object->setEmail($customerType->getEmail()); $object->setName($customerType->getName()); $object->setLastName($customerType->getLastName()); $object->setPhoneNumber($customerType->getPhoneNumber()); $storeType = $this->storeMapper->create($customerType->getStore()); $object->setStore($storeType); return $object; }
/** * @param OpenpayCustomerType $object * @param array $data * @return OpenpayCustomerType */ public function populate(OpenpayCustomerType $object, array $data) { $object->setName($data['name']); $object->setLastName($data['last_name']); $object->setEmail($data['email']); $object->setPhoneNumber($data['phone_number']); $object->setClabe($data['clabe']); if (isset($data['address'])) { $addressType = $this->addressMapper->create($data['address']); $object->setAddress($addressType); } if (isset($data['creation_date'])) { $object->setCreationDate($data['creation_date']); } if (isset($data['id'])) { $object->setId($data['id']); } if (isset($data['status'])) { $object->setStatus($data['status']); } if (isset($data['balance'])) { $object->setBalance($data['balance']); } if (isset($data['store'])) { $storeType = $this->storeMapper->create($data['store']); $object->setStore($storeType); } return $object; }