На текущий момент на сайте 3 группы, все JOIN_POLICY_PRIVATE.
public function getInvitableGroups($user_id){ $this->select('m.role', 'role'); $this->joinInner('groups_members', 'm', "m.user_id = '{$user_id}'"); $groups = $this->get('groups', function($group, $model){ $is_can_invite = $is_can_invite || (($group['join_policy'] == groups::JOIN_POLICY_PRIVATE) && ($group['role'] == groups::ROLE_STAFF)); if (!$is_can_invite){ return false; } return $group; }); return $groups; }