[TYPO3-mvc] Cannot get findByProperty to work

Claus Due claus at wildside.dk
Mon Jan 2 13:59:26 CET 2012


Hi Mark, Henjo,

> when you use the magic of the findByProperty methods, keep in mind the
> return will be an object storage (unless you return them specifically as an
> array - like you did with Franz' snippet).

Actually it wil be a QueryResult, not an ObjectStorage, which means it will not have been executed yet (->toArray() executes the QueryResult first). These QueryResults can be used in Paginate Widgets for example, to manipulate the QueryResult's query settings before it actually gets executed.

If you want Pagination or other QueryResult features naturally you should adapt your code instead of using ->toArray(). You should consider ->toArray() a fallback to be used only in cases where a QueryResult definitely cannot be supported.

Cheers,
Claus


More information about the TYPO3-project-typo3v4mvc mailing list