I have created the phalcon models and relationship as per they provided the document but getting the error "Notice: Undefined property: Phalcon\Mvc\Model\Resultset\Simple::$GroupsMembers in /var/www/html/uno/apps/webservice/controllers/UserController.php on line 245" while trying to fetch related records in many to many relationship.
I have 3 tables users, groups and group_members. group_members contain the relationship for groups and users.I want to get the all subscribed groups for a member therefore I have used below statements in UserController:
$user = Users::find('id = '.$user_id); $subscribed_groups = $user->groupsMembers; foreach($groupMembers as $groupMember){ echo $groupMember->groups->title; }
It gives the error mentioned above.
Please visit the link below to see my tables, models and controller.
Thanks.