FAQ Database Discussion Community

Typo3 extbase database query

I have an extbase database query like below. $query = $this->createQuery(); $result = $query->statement("Select * FROM table1 WHERE hidden = 0 AND deleted = 0 AND (".$PublicationYears.") AND logo != '' ORDER BY uid ASC LIMIT 0, ".$iLimit." ")->execute(); return $result; $PublicationYears = "ttra = '12' or ttra = '13'...

What is returned by calling 'where'?

I have following question, let @post=Post.where(title: "title1") what should be @post if "title1" exists or not? How can I check if 'where' returned any element? In my application I just called if(@post) .... else .... end but it always get into else...