/** * Map profile from persit to profile entity * * @param Application_Model_ProfileInterface $profile * @return [] */ private function mapFromEntity(Application_Model_ProfileInterface $profile) { $profilePersit = []; if ($profile->getId()) { $profilePersit['id'] = $profile->getId(); } if ($profile->getBirthDay()) { $profilePersit['dob'] = $profile->getBirthDay()->format('Y-m-d'); } if ($profile->getEmail()) { $profilePersit['email'] = $profile->getEmail(); } if ($profile->getFullname()) { $profilePersit['fullname'] = $profile->getFullname(); } return $profilePersit; }
public function bindFromProfile(Application_Model_ProfileInterface $profile) { $this->populate([self::ELEMENT_ID => $profile->getId() ? $profile->getId() : NULL, self::ELEMENT_DOB => $profile->getBirthDay() ? $profile->getBirthDay()->format('Y-m-d') : NULL, self::ELEMENT_EMAIL => $profile->getEmail(), self::ELEMENT_FULLNAME => $profile->getFullname()]); }