/** * @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); }
/** * {@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); }
/** * {@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); }