[TYPO3-mvc] findBy[Property] problems
Lorenz Ulrich
lorenz-typo3 at visol.ch
Fri Feb 11 21:21:30 CET 2011
Hi there
Seems to be a pretty rough way for me to get into the extbase flow :-).
I have an extension with an addressRepository that uses the tt_address
table. Saving new addresses works fine.
But when inserting a new address I would like to check if it's a
duplicate. So I use this magic findBy[property] method:
$existing = $this->addressRepository->findByEmail('mail at dress.com')
But the only thing I get back is the following warning:
You should never see this warning. If you do, you probably used PHP
array functions like current() on the
Tx_Extbase_Persistence_QueryResult. To retrieve the first result, you
can use the getFirst() method.
The problem is that I don't use any PHP array functions, just built-in
Extbase stuff.
This happens on TYPO3 4.6dev, storagePid is set. In TYPO3 4.3 the same
code worked fine.
I followed your advice to use the DI instead of makeInstance for the
addressRepository but it had no effect.
If anyone has an idea what I could be doing wrong, let me know :-).
Thanks and regards,
Lorenz
More information about the TYPO3-project-typo3v4mvc
mailing list