Ejemplo n.º 1
0
 public function hydrate(array $data, $object)
 {
     if (!$object instanceof UserEntityInterface) {
         throw new \ZfcUser\Mapper\Exception\InvalidArgumentException('$object must be an instance of ZfcUser\\Entity\\UserInterface');
     }
     return parent::hydrate($data, $object);
 }
Ejemplo n.º 2
0
 /**
  * Extract values from an object
  *
  * @param object $object        	
  * @return array
  * @throws Exception\InvalidArgumentException
  */
 public function extract($object)
 {
     if (!$object instanceof UserEntityInterface) {
         throw new Exception\InvalidArgumentException('$object must be an instance of ZfcUser\\Entity\\UserInterface');
     }
     /* @var $object UserInterface */
     $data = parent::extract($object);
     if ($data['id'] !== null) {
         $data = $this->mapField('id', 'apiKey', $data);
     } else {
         unset($data['id']);
     }
     return $data;
 }