Group visibility methods.
More...
|
static | can_view_all_groups (int $courseid) |
| Can the current user view all the groups on the course?
|
|
static | course_has_hidden_groups (int $courseid) |
| Return whether a course currently had hidden groups.
|
|
static | sql_group_visibility_where (int $userid, string $groupsalias='g', string $groupsmembersalias='gm') |
| Return SQL conditions for determining whether a user can see a group and its memberships.
|
|
static | sql_member_visibility_where (string $groupsalias='g', string $groupsmembersalias='gm', string $useralias='u', string $paramprefix='',) |
| Return SQL conditions for determining whether a user can see a group's members.
|
|
static | update_hiddengroups_cache (int $courseid, ?\cache $cache=null) |
| Store the number groups with visibility other than ALL on the course.
|
|
|
static | sql_members_visibility_condition (string $groupsalias='g', string $groupsmembersalias='gm', string $paramprefix='',) |
| Return a condition to check if a user can view a group because it has MEMBERS visibility and they are a member.
|
|
Group visibility methods.
◆ can_view_all_groups()
static core_group\visibility::can_view_all_groups |
( |
int | $courseid | ) |
|
|
static |
Can the current user view all the groups on the course?
Returns true if there are no groups on the course with visibility != ALL, or if the user has viewhiddengroups.
This is useful for deciding whether we need to perform additional visibility checkes such as the sql_* methods of this class.
- Parameters
-
- Return values
-
◆ course_has_hidden_groups()
static core_group\visibility::course_has_hidden_groups |
( |
int | $courseid | ) |
|
|
static |
Return whether a course currently had hidden groups.
This can be used as a shortcut to decide whether visibility restrictions need to be applied. If this returns false, we may be able to use cached data, or do a much simpler query.
- Parameters
-
- Return values
-
- Exceptions
-
◆ sql_group_visibility_where()
static core_group\visibility::sql_group_visibility_where |
( |
int | $userid, |
|
|
string | $groupsalias = 'g', |
|
|
string | $groupsmembersalias = 'gm' ) |
|
static |
Return SQL conditions for determining whether a user can see a group and its memberships.
- Parameters
-
int | $userid | |
string | $groupsalias | The SQL alias being used for the groups table. |
string | $groupsmembersalias | The SQL alias being used for the groups_members table. |
- Return values
-
◆ sql_member_visibility_where()
static core_group\visibility::sql_member_visibility_where |
( |
string | $groupsalias = 'g', |
|
|
string | $groupsmembersalias = 'gm', |
|
|
string | $useralias = 'u', |
|
|
string | $paramprefix = '' ) |
|
static |
Return SQL conditions for determining whether a user can see a group's members.
- Parameters
-
string | $groupsalias | The SQL alias being used for the groups table. |
string | $groupsmembersalias | The SQL alias being used for the groups_members table. |
string | $useralias | The SQL alias being used for the user table. |
string | $paramprefix | Prefix for the parameter names. |
- Return values
-
◆ sql_members_visibility_condition()
static core_group\visibility::sql_members_visibility_condition |
( |
string | $groupsalias = 'g', |
|
|
string | $groupsmembersalias = 'gm', |
|
|
string | $paramprefix = '' ) |
|
staticprotected |
Return a condition to check if a user can view a group because it has MEMBERS visibility and they are a member.
- Parameters
-
string | $groupsalias | The SQL alias being used for the groups table. |
string | $groupsmembersalias | The SQL alias being used for the groups_members table. |
string | $paramprefix | Prefix for the parameter names. |
- Return values
-
◆ update_hiddengroups_cache()
static core_group\visibility::update_hiddengroups_cache |
( |
int | $courseid, |
|
|
?\cache | $cache = null ) |
|
static |
Store the number groups with visibility other than ALL on the course.
- Parameters
-
int | $courseid | Course ID to update the cache for. |
cache | null | $cache | Existing cache instance. If null, once will be created. |
- Return values
-
- Exceptions
-
The documentation for this class was generated from the following file:
- group/classes/visibility.php