Ouzo\Utilities\Iterator\BatchingIterator::rewind PHP Метод

rewind() публичный Метод

public rewind ( )
    public function rewind()
    {
        $this->position = 0;
        $this->iterator->rewind();
    }

Usage Example

Пример #1
0
 /**
  * @test
  */
 public function shouldRewindIterator()
 {
     $ait = new ArrayIterator(array('a', 'b', 'c', 'd'));
     $ait->next();
     $ait->next();
     $batchIterator = new BatchingIterator($ait, 2);
     //when
     $batchIterator->rewind();
     //then
     $this->assertEquals(array(array('a', 'b'), array('c', 'd')), iterator_to_array($batchIterator));
 }