I know that when I try top use fetchAll
and it returns a fatal error, the reason is because it has returned no records on the query. But my question is, how to treat it? How can I know if the query will not return any records, so i do not use toArray()
?
For instance,
$table = new Application_Model_Proucts();
$products = $table->fetchAll()->toArray();
How can I do a verification of the query before I put the toArray
method?