public function extract($object) { if (!$object instanceof UserEntityInterface) { throw new \ZfcUser\Mapper\Exception\InvalidArgumentException('$object must be an instance of ZfcUser\\Entity\\UserInterface'); } $data = parent::extract($object); return $data; }
/** * 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; }