Function __global->cns_get_members_groups

Definitions

sources/cns_groups.php

  • Get a list of the usergroups a member is in (keys say the usergroups, values are irrelevant).
  • Visibility: public
  • Is abstract?: No
  • Is static?: No
  • Is final?: No
  • Returns: array

Parameters

Name Type Passed by reference? Variadic? Default Set Range Description
$member_id ?MEMBER No No Null N/A N/A The member to find the usergroups of (null: current member)
$skip_secret boolean No No False N/A N/A Whether to skip looking at secret usergroups, unless we have access
$handle_probation boolean No No True N/A N/A Whether to take probation into account
$include_implicit boolean No No True N/A N/A Whether to include implicit groups
$skip_cache boolean No No False N/A N/A Whether to skip the user groups cache

Returns

  • Flipped list (e.g. [1=>true,2=>true,3=>true] for someone in (1,2,3)).
  • Type: array
  • Set: N/A
  • Range: N/A

Preview

Code (PHP)

/**
 * Get a list of the usergroups a member is in (keys say the usergroups, values are irrelevant).
 *
 * @param  ?MEMBER $member_id The member to find the usergroups of (null: current member)
 * @param  boolean $skip_secret Whether to skip looking at secret usergroups, unless we have access
 * @param  boolean $handle_probation Whether to take probation into account
 * @param  boolean $include_implicit Whether to include implicit groups
 * @param  boolean $skip_cache Whether to skip the user groups cache
 * @return array Flipped list (e.g. [1=>true,2=>true,3=>true] for someone in (1,2,3)).
 */

function cns_get_members_groups(?int $member_id = null, bool $skip_secret = false, bool $handle_probation = true, bool $include_implicit = true, bool $skip_cache = false) : array