public function insert(array $data) { $customerTypeEntity = $this->entityManager->getReference('Domain\\Entity\\Customer\\CustomerTypeEntity', $data['customerTypeId']); $customerEntity = new CustomerEntity(); $customerEntity->setName($data['name'])->setBirthDate(new \DateTime($data['birthDate']))->setGender($data['gender'])->setCpf($data['cpf'])->setEmail($data['email'])->setPhone1($data['phone1'])->setPhone2($data['phone2'])->setRegistrationDate(new \DateTime('now'))->setCustomerType($customerTypeEntity); return $this->commit($customerEntity); }
/** * {@inheritDoc} */ public function setCustomerType($customerType) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCustomerType', array($customerType)); return parent::setCustomerType($customerType); }