/** * {@inheritdoc} */ public function rewind() { if ($this->iterator) { $this->iterator->rewind(); return; } $this->iterator = $this->collection->getIterator(); $this->iterator->rewind(); }
public function testGetIterator() { $data = array('bar1', 'bar2', 'bar3'); $col = new PropelCollection($data); $it1 = $col->getIterator(); $it2 = $col->getIterator(); $this->assertNotSame($it1, $it2, 'getIterator() returns always a new iterator'); }