Exemplo n.º 1
0
 /**
  *
  * @static
  * @param User user
  * @param array $fields
  */
 public static function populate($user, $fields)
 {
     parent::populate($user, $fields);
     if (!$user instanceof User) {
         static::throwException("El objecto no es un User");
     }
     if (isset($fields['id_user'])) {
         $user->setIdUser($fields['id_user']);
     }
     if (isset($fields['id_person'])) {
         $user->setIdPerson($fields['id_person']);
     }
     if (isset($fields['id_access_role'])) {
         $user->setIdAccessRole($fields['id_access_role']);
     }
     if (isset($fields['username'])) {
         $user->setUsername($fields['username']);
     }
     if (isset($fields['password'])) {
         $user->setPassword($fields['password']);
     }
     if (isset($fields['status'])) {
         $user->setStatus($fields['status']);
     }
     if (isset($fields['notifications'])) {
         $user->setNotifications($fields['notifications']);
     }
 }
Exemplo n.º 2
0
 /**
  *
  * @static
  * @param Contact contact
  * @param array $fields
  */
 public static function populate($contact, $fields)
 {
     parent::populate($contact, $fields);
     if (!$contact instanceof Contact) {
         static::throwException("El objecto no es un Contact");
     }
     if (isset($fields['id_contact'])) {
         $contact->setIdContact($fields['id_contact']);
     }
     if (isset($fields['id_person'])) {
         $contact->setIdPerson($fields['id_person']);
     }
     if (isset($fields['id_company'])) {
         $contact->setIdCompany($fields['id_company']);
     }
     if (isset($fields['position'])) {
         $contact->setPosition($fields['position']);
     }
 }
Exemplo n.º 3
0
 /**
  *
  * makeBean
  * @param array $resultset
  * @return \Application\Model\Bean\Person
  */
 protected function makeBean($resultset)
 {
     return PersonFactory::createFromArray($resultset);
 }