[TYPO3-mvc] Strange behavior with ObjectStorage

Franz Koch typo3.RemoveForMessage at elements-net.de
Tue Jan 26 23:43:47 CET 2010


Hi list,

I encountered a strange behavior with instances of ObjectStorage. On 
freshly injected ObjectStorage containers already having objects in 
them, the "current" method doesn't seem to work. It's only working after 
first calling "rewind". So I have to do this:

$products = $this->getProducts(); //prefilled from extbase with a 
ObjectStorage
$products->rewind();
$currentProduct = $products->current();

instead of:

$currentProduct = $this->getProducts()->current();

But I think this should work out of the box like this, doesn't it?


I also noticed that "rewind" isn't returning anything - so it doesn't 
allow for chaining (I'll add a patch on forge for this).
-- 
kind regards,
Franz Koch


More information about the TYPO3-project-typo3v4mvc mailing list