[TYPO3-mvc] How to check if object was created ?

Dawid Pacholczyk dpacholczyk at gmail.com
Tue Mar 8 11:56:10 CET 2011


Works great !

Thank you for the tip. I learned something new :)

Thank you both for help.

Best regards,
Dawid Pacholczyk

W dniu 2011-03-08 11:10, Marc Bastian Heinrichs pisze:
> 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