[TYPO3-mvc] How to check if object was created ?
Marc Bastian Heinrichs
typo3 at mbh-web.de
Tue Mar 8 11:10:58 CET 2011
Hey,
>> Not always I`ll find an object in database so I need to check before
>> I`ll use for example $temp->getUid()
>>
>> How can I do that ?
>
> just have a look at the php documentation or google ;P
>
> if ($temp !== NULL && is_object($temp)) {
> // do something
> }
the result is an QueryResult object, so this will fail.
David, check out the Tx_Extbase_Persistence_QueryResult class -
count() should be the best, because valid() is not api.
Best
Marc Bastian
More information about the TYPO3-project-typo3v4mvc
mailing list