[TYPO3-mvc] Iterate through ObjectStorage Object using offset

Jochen Rau jochen.rau at typoplanet.de
Tue May 25 18:05:36 CEST 2010


Hi Kevin.

On 25.05.10 17:48, Kevin Ulrich Moschallski wrote:
> i have an ObjectStorage Object ($contentelements) which contains an array of objects. I now want to go through the array in the object storage. When i call
>
> $contentelements->current()
>
> i get the first object. When i add
>
> $contentelements->next()
>
> before this i get the second one. So far so good, but i want to set an offset, because i want to use a page browser to display the objects.
>
> I tried to use $contentelements->offsetSet() on the object but i can't figure out how to use this properly or if this is the right way to do this.
>
> Did somebody ever tried this, i just can't find any information on google or in this mailing list.

With r2287 I committed earlier today, the ObjectStorage of Extbase 
behaves exactly the same as the SplObjectStorage. You can find more 
documentation here:

http://de.php.net/manual/en/class.splobjectstorage.php

Regards
Jochen


More information about the TYPO3-project-typo3v4mvc mailing list