Version: current

# Class DataObjectSet_Iterator

An Iterator for a DataObjectSet

  DataObjectSet_Iterator implements Iterator

Package: sapphire\model
Located at sapphire/core/model/DataObjectSet.php

## Methods summary

`public` | # `__construct( mixed $items )`
`protected `DataObject`` | # `prepareItem( `DataObject` $item )` Prepare an item taken from the internal array for output by this iterator. Ensures that it is an object. Prepare an item taken from the internal array for output by this iterator. Ensures that it is an object. #### Parameters $item DataObject $item Item to prepare #### Returns ``DataObject`` DataObject
`public `DataObject`` | # `current( )` Return the current object of the iterator. Return the current object of the iterator. #### Returns ``DataObject`` DataObject #### Implementation of `Iterator::current()`
`public mixed` | # `key( )` Return the key of the current object of the iterator. Return the key of the current object of the iterator. #### Returns `mixed` mixed #### Implementation of `Iterator::key()`
`public `DataObject`` | # `next( )` Return the next item in this set. Return the next item in this set. #### Returns ``DataObject`` DataObject #### Implementation of `Iterator::next()`
`public `DataObject`` | # `rewind( )` Rewind the iterator to the beginning of the set. Rewind the iterator to the beginning of the set. #### Returns ``DataObject`` The first item in the set. #### Implementation of `Iterator::rewind()`
`public boolean` | # `valid( )` Check the iterator is pointing to a valid item in the set. Check the iterator is pointing to a valid item in the set. #### Returns `boolean` boolean #### Implementation of `Iterator::valid()`
`public `DataObject`` | # `peekNext( )` Return the next item in this set without progressing the iterator. Return the next item in this set without progressing the iterator. #### Returns ``DataObject`` DataObject
`public `DataObject`` | # `peekPrev( )` Return the prvious item in this set, without affecting the iterator. Return the prvious item in this set, without affecting the iterator. #### Returns ``DataObject`` DataObject
`public `DataObject`|boolean` | # `getOffset( integer $offset )` Return the object in this set offset by $offset from the iterator pointer. Return the object in this set offset by $offset from the iterator pointer. #### Parameters $offset int $offset The offset. #### Returns ``DataObject`|boolean` DataObject of offset item, or boolean FALSE if not found

### Magic methods summary

[Raise a SilverStripe Framework issue/bug](https://github.com/silverstripe/silverstripe-framework/issues/new)
- [Raise a SilverStripe CMS issue/bug](https://github.com/silverstripe/silverstripe-cms/issues/new)
- Please use the Silverstripe Forums to ask development related questions. -