Ejemplo n.º 1
0
 /**
  * {@inheritdoc}
  */
 public function toArray()
 {
     $a = parent::toArray();
     foreach ($this->exclude as $k) {
         unset($a[$k]);
     }
     return $a;
 }
Ejemplo n.º 2
0
 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();
 }
Ejemplo n.º 3
0
 public function toArray()
 {
     $list = parent::toArray();
     unset($list['type']);
     return $list;
 }
Ejemplo n.º 4
0
 /**
  * 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));
 }
Ejemplo n.º 5
0
 protected function decoratorEntity(EntityAbstract $entity)
 {
     $entity->setLogger($this->getLogger());
     return $entity;
 }
Ejemplo n.º 6
0
 public function __construct($checkoutUrl = '')
 {
     parent::__construct();
     $this->setCheckoutUrl($checkoutUrl);
 }
Ejemplo n.º 7
0
 public function toArray()
 {
     return array_intersect_key(parent::toArray(), ['status' => null, strtolower($this->getStatus()) => null]);
 }
Ejemplo n.º 8
0
 public function toArray()
 {
     $array = parent::toArray();
     unset($array['sender']);
     return $array;
 }