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

Joined table setter and getter

Hi all,

i create a query like that :

 $sql = "SELECT * FROM BlogText where status = '1'";

    if($params)
    {

        if(isset($params['category_id']))
        {
            $sql .= " and category_id = '".$params['category_id']."'";
        }

        if(isset($params['author_id']))
        {
            $sql .= " and author_id = '".$params['author_id']."'";
        }

    }

    $sql .= " LIMIT 12 OFFSET $page";

my models has getter and setter . When i want to join blog author table to that table with Inner Join getter and setters not working. Couldnt find any getter and setter .How can i solve that ?



8.1k

Could your issue have something to do with what is discussed here: https://forum.phalcon.io/discussion/2409/a-cry-for-help-while-using-joins-in-phalcon?

I.e.; you have to specifiy all joined tables in the SELECT statement?