/** * getIterator * * @return array|\Traversable */ public function getIterator() { $a = new ArrayObject($this->toArray()); return $a->getIterator(); }
/** * Returns the collection iterator. * * @return \Iterator */ public function getIterator() { return $this->entities->getIterator(); }
public function testIterator() { $ar = new ArrayObject(array('1' => 'one', '2' => 'two', '3' => 'three')); $iterator = $ar->getIterator(); $iterator2 = new \ArrayIterator($ar->getArrayCopy()); $this->assertEquals($iterator2->getArrayCopy(), $iterator->getArrayCopy()); }