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

Relationships where statement

I have this model, where i am trying to check if the notification has been seen.

$this->hasOne('id', 'NotificationsSeen', 'notificationid', array(
        'alias' => 'seen',
        'reusable' => true
    ));

But I need one more statement to complete the relationship. Is there anyway i can pass one more where statement into the relationship. Maybe like this:

$this->hasOne('id, userid', 'NotificationsSeen', 'notificationid, userid', array(
        'alias' => 'seen',
        'reusable' => true
    ));

Is there anyway to do this with relationship? Without using modelManager

do you try with params parameter? docs

Maybe you should use hasManyToMany then?