[TYPO3-mvc] blog_example: "You should never see this warning."

Dmitry Dulepov dmitry.dulepov at gmail.com
Mon Feb 21 14:34:55 CET 2011


Hi Bastian!

Bastian Waidelich wrote:
> Since version 1.3.0 $query->execute() returns an instance of
> Tx_Extbase_Persistence_QueryResultInterface instead of an array with the
> records (see [1]).
>
> Due to an inconsistency of PHP, the array_()* methods, and some
> iteration methods like current() do not work on the QueryResult (or
> objects which implement ArrayAccess in general).
>
> The real issue is: There is no way to catch the case that someone calls
> current() on the ResultObject. Instead of calling the "current()" method
> of the Interface, PHP will return the first field of the object - even
> if it is private!
> The pragmatic solution was to add a private field that contains the
> warning "You should never see this warning..." so you would at least get
> a hint if you debug the result.

Thanks for such a detailed explanation!

I use stock blog_example without modifications and only its "index" action, 
which is:

public function indexAction() {
	$this->view->assign('blogs', $this->blogRepository->findAll());
}

Does that mean that current() PHP function is called on this object inside 
Extbase?

-- 
Dmitry Dulepov
TYPO3 core&security team member
E-mail: dmitry.dulepov at typo3.org
Web: http://dmitry-dulepov.com/


More information about the TYPO3-project-typo3v4mvc mailing list