We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

findFirst

$rollerInfo = Roller::findFirst(array(
        'id' => 1,
));
var_dump($rollerInfo);
exit;

Regardless of has a return value to check the data, how can I determine what do you have any query to the record?



98.9k

Can you elaborate on "how can I determine what do you have any query to the record?"



11.2k

I believe OPs question is something like How to know if a query has returned anything using the ORM

    $rollerInfo = Roller::findFirst(
        array(
            'id'    => 1
        )
    );

    if ($rollerInfo) {
        //This is only true if it returned a row
    } else {
        //No results for your query
    }