Hector Virgen wrote:
> 
> Calling empty() on a rowset (Zend_Db_Table_Rowset) always returns false,
> even if the rowset has zero rows. Is there a way to make rowsets (or any
> iterator) work with empty()? Or is !count($rowset) the only way to test
> for
> an empty rowset?
> 

You need to use count() or you could use the $rowset->count() method
directly. In the case of the Rowset class the "count" of returned rows is
held directly in a property so youre not iterating through each time its
called to get the value its simply returning.

If you actually need a boolean value you can cast it or you could extend
rowset and implemnt a method to do this and then call that.

Is there a particular reason you wanted to use empty (aside from traditional
count/empty performance)?
-- 
View this message in context: 
http://www.nabble.com/Rowsets-and-empty%28%29-tp26116340p26117087.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to