Exemplo n.º 1
0
 /**
  * Set criteria
  * 
  * @access public
  * 
  * @param Doctrine\Common\Collections\Criteria $criteria
  */
 public function setCriteria($criteria)
 {
     $this->paginator->getAdapter()->setCriteria($criteria);
 }
Exemplo n.º 2
0
 /**
  * @group ZF-9396
  */
 public function testArrayAccessInClassSerializableLimitIterator()
 {
     $iterator = new \ArrayIterator(array('zf9396', 'foo', null));
     $paginator = new Paginator\Paginator(new Adapter\Iterator($iterator));
     $this->assertEquals('zf9396', $paginator->getItem(1));
     $items = $paginator->getAdapter()->getItems(0, 10);
     $this->assertEquals('foo', $items[1]);
     $this->assertEquals(0, $items->key());
     $this->assertFalse(isset($items[2]));
     $this->assertTrue(isset($items[1]));
     $this->assertFalse(isset($items[3]));
 }
 /**
  * Get the alias of $paginator
  *
  * @param Zend\Paginator\Paginator $paginator
  * @return string
  */
 private function getAlias(Paginator $paginator)
 {
     $alias = '';
     $adapter = $paginator->getAdapter();
     if ($adapter instanceof Adapter) {
         $alias = $adapter->getAlias();
     }
     return $alias;
 }