コード例 #1
0
 public function testFetchColWithEmptyTable()
 {
     $table = new \ReflectionProperty('Database\\AbstractTable', 'table');
     $table->setAccessible(true);
     $table->setValue($this->_table, 'test2');
     $this->_table->initialize();
     $this->assertSame(array(), $this->_table->fetchCol('col1'));
 }
コード例 #2
0
 /** {@inheritdoc} */
 public function initialize()
 {
     $this->_hydrator = new \Zend\Stdlib\Hydrator\ArraySerializable();
     $this->_hydrator->setNamingStrategy(new \Database\Hydrator\NamingStrategy\MapNamingStrategy(array('id' => 'Id', 'name' => 'Name', 'description' => 'Description', 'lastdate' => 'CreationDate', 'request' => 'DynamicMembersSql', 'create_time' => 'CacheCreationDate', 'revalidate_from' => 'CacheExpirationDate')));
     $dateTimeFormatter = new \Zend\Stdlib\Hydrator\Strategy\DateTimeFormatterStrategy($this->_serviceLocator->get('Database\\Nada')->timestampFormatPhp());
     $this->_hydrator->addStrategy('CreationDate', $dateTimeFormatter);
     $this->_hydrator->addStrategy('lastdate', $dateTimeFormatter);
     $cacheCreationDateStrategy = new \Database\Hydrator\Strategy\Groups\CacheDate();
     $this->_hydrator->addStrategy('CacheCreationDate', $cacheCreationDateStrategy);
     $this->_hydrator->addStrategy('create_time', $cacheCreationDateStrategy);
     $cacheExpirationDateStrategy = new \Database\Hydrator\Strategy\Groups\CacheDate($this->_serviceLocator->get('Model\\Config')->groupCacheExpirationInterval);
     $this->_hydrator->addStrategy('CacheExpirationDate', $cacheExpirationDateStrategy);
     $this->_hydrator->addStrategy('revalidate_from', $cacheExpirationDateStrategy);
     $this->resultSetPrototype = new \Zend\Db\ResultSet\HydratingResultSet($this->_hydrator, $this->_serviceLocator->get('Model\\Group\\Group'));
     return parent::initialize();
 }
コード例 #3
0
ファイル: Clients.php プロジェクト: hschletz/braintacle
 /**
  * {@inheritdoc}
  * @codeCoverageIgnore
  */
 public function initialize()
 {
     $this->_hydrator = new \Database\Hydrator\Clients($this->_serviceLocator);
     $this->resultSetPrototype = new \Zend\Db\ResultSet\HydratingResultSet($this->_hydrator, $this->_serviceLocator->get('Model\\Client\\Client'));
     return parent::initialize();
 }