i have a very simple question. i searched for it everywhere but i didn't find anything.
i have a Doctrine query like this:
return Doctrine_Core::getTable('something')->createQuery()->where('where clause')-
>execute();
i want to check whether it returns something or not. just it. if it's content is null i don't do other stuff. empty doesn't work, isset doesn't work ,count doesn't work . what am i suppose to do?
i know it's so simple but i don't know how to do it.
any suggestions would be appreciated.
Try the following code:
return Doctrine_Core::getTable('something')
->createQuery()->where('where clause')->count();
What about executing ->count()
on result array?
$obj = Doctrine_Core::getTable('something')->createQuery()->where('where clause')->execute();
if ($obj == null) { }enter code here
else { }