/** * {@inheritdoc} */ public function toArray() { $a = parent::toArray(); foreach ($this->exclude as $k) { unset($a[$k]); } return $a; }
public function toArray() { if ($this->elementEmpty('dateInit')) { $this->setDateInit(''); } if ($this->elementEmpty('dateEnd')) { $this->setDateEnd(date('Y-m-d', strtotime('+1 month', strtotime('NOW')))); } return parent::toArray(); }
public function toArray() { $list = parent::toArray(); unset($list['type']); return $list; }
/** * Exibe a documentação automática para Entidades. * * Contém os métodos mágicos e é exibida quando o segundo parâmetro enviados ao * phpunit é --stderr desde que o método setUpBeforeClass() do teste seja * implementado conforme exemplo a seguir * * <code> * //... * public static function setUpBeforeClass() * { * self::displayClassDocumentation(new Product()); * } * //... * </code> * * @param EntityInterface $entity [description] */ public static function displayClassDocumentation(EntityAbstract $entity) { global $argv; if (count($argv) <= 1 || $argv[1] !== '--stderr') { return false; } echo Docblock::getInstance()->setResourcesPath(static::getResourcesPath())->generate($entity->toDocBLock(), json_encode($entity->toArray(), JSON_PRETTY_PRINT)); }
public function toArray() { return array_intersect_key(parent::toArray(), ['status' => null, strtolower($this->getStatus()) => null]); }
public function toArray() { $array = parent::toArray(); unset($array['sender']); return $array; }