/** * Override getItems() * * Overrides getItems() to return a collection of entities based on the * provided Hydrator and entity prototype, if available. * * @param int $offset * @param int $itemCountPerPage * @return array */ public function getItems($offset, $itemCountPerPage) { $set = parent::getItems($offset, $itemCountPerPage); if (!$this->hydrator instanceof HydratorInterface) { return $set; } $collection = array(); foreach ($set as $item) { $collection[] = $this->hydrator->hydrate($item, clone $this->entityPrototype); } return $collection; }
/** * @group ZF-4151 */ public function testEmptySet() { $this->adapter = new Adapter\ArrayAdapter(array()); $actual = $this->adapter->getItems(0, 10); $this->assertEquals(array(), $actual); }