/**
  * @param  string|int  $id
  * @return object|null
  */
 public function findById($id)
 {
     if (null === $id || '' === $id) {
         return;
     }
     $resultSet = $this->tableGateway->findById($id);
     return $this->buildOneModelFromResultSet($resultSet);
 }
Exemplo n.º 2
0
 /**
  * {@inheritDoc}
  */
 public function setup($options = array())
 {
     foreach (array_keys($this->column) as $key) {
         if (isset($options[$key])) {
             $this->column[$key] = (string) $options[$key];
             unset($options[$key]);
         }
     }
     parent::setup($options);
 }
Exemplo n.º 3
0
 /**
  * {@inheritDoc}
  */
 public function initialize()
 {
     if ($this->initialized == true) {
         return;
     }
     parent::initialize();
     $rowObject = $this->resultSetPrototype->getArrayObjectPrototype();
     if (is_callable(array($rowObject, 'setTableGateway'))) {
         $rowObject->setTableGateway($this);
     }
 }
 /**
  * @covers VisioCrudModeler\Model\TableGateway\AbstractTable:delete
  */
 public function testDelete()
 {
     $this->entity->id = 5;
     $this->table->delete($this->entity);
 }