Group
in package
implements
ArrayAccess
uses
ArrayAccessHelper
Represents a member group.
Table of Contents
Interfaces
- ArrayAccess
Constants
- ADMIN = 1
- GLOBAL_MOD = 2
- GUEST = -1
- INVISIBLE = 2
- LOAD_BOTH = 3
- LOAD_NORMAL = 1
- LOAD_POST = 2
- MOD = 3
- NEWBIE = 4
- NO_GROUP_KEY = 1
- NONE = -2
- REGULAR = 0
- TYPE_FREE = 3
- TYPE_PRIVATE = 0
- TYPE_PROTECTED = 1
- TYPE_REQUESTABLE = 2
- VISIBLE = 0
Properties
- $boards_can_moderate : array<string|int, mixed>
- $can_moderate : bool
- $children : array<string|int, mixed>
- $description : string
- $hidden : int
- $icon_count : int
- $icon_image : string
- $id : int
- $loaded : array<string|int, mixed>
- $max_messages : int
- $members : array<string|int, mixed>
- $min_posts : int
- $moderator_ids : array<string|int, mixed>
- $moderators : array<string|int, mixed>
- $name : string
- $num_members : int
- $num_permissions : array<string|int, mixed>
- $online_color : string
- $parent : int
- $permissions : array<string|int, mixed>
- $raw_icons : string
- $tfa_required : bool
- $type : int
- $post_groups : array<string|int, mixed>
- $prop_aliases : array<string|int, mixed>
- $unassignable : array<string|int, mixed>
Methods
- __construct() : mixed
- Constructor.
- __set() : void
- Sets custom properties.
- addMembers() : bool
- Adds members to this group.
- countMembers() : int
- Counts how many members are in this group.
- countMembersBatch() : array<string|int, mixed>
- Like $this->countMembers(), except that this is more efficient when working on a batch of groups.
- countPermissions() : array<string|int, mixed>
- Counts the allowed and denied permissions for this group.
- countPermissionsBatch() : array<string|int, mixed>
- Like $this->countPermissions(), except that this is more efficient when working on a batch of groups.
- delete() : bool|string
- Deletes this group.
- fixMembership() : void
- Ensures membership is correct for post groups, hidden groups, and the moderator group.
- getBoardsCanModerate() : array<string|int, mixed>
- Loads the IDs of any boards that this group can moderate.
- getCachedList() : array<string|int, mixed>
- Retrieve a list of (visible) membergroups used by the cache.
- getChildren() : array<string|int, mixed>
- Loads the IDs and names of groups that inherit permissions from this group.
- getPostGroups() : array<string|int, mixed>
- Returns the IDs of all post-count based groups.
- getUnassignable() : array<string|int, mixed>
- Populates self::$unassignable with the IDs of any groups that the current user cannot assign.
- load() : array<string|int, mixed>
- Loads groups by ID number and/or by custom query.
- loadAssignable() : array<string|int, mixed>
- Loads groups that the current user can assign people to.
- loadMembers() : array<string|int, mixed>
- Loads the IDs of all the members of this group.
- loadModerators() : void
- Loads the IDs of the moderators of this group.
- loadModeratorsBatch() : void
- Like $this->loadModerators(), except that this is more efficient when working on a batch of groups.
- loadPermissions() : array<string|int, mixed>
- Loads the permissions for this group.
- loadPermissionsBatch() : array<string|int, mixed>
- Like $this->loadPermissions(), except that this is more efficient when working on a batch of groups.
- loadSimple() : array<string|int, mixed>
- Convenience method to load specific sorts of groups.
- offsetExists() : bool
- Checks whether a property has been set when object is accessed as an array.
- offsetGet() : mixed
- Gets properties when object is accessed as an array.
- offsetSet() : void
- Sets properties when object is accessed as an array.
- offsetUnset() : void
- Unsets properties when object is accessed as an array.
- removeMembers() : bool
- Remove one or more members from one or more membergroups.
- save() : void
- Saves this group to the database.
- updateBoardAccess() : void
- Updates the boards this group has access to.
- canBeAdditional() : bool
- Returns whether the given group can be an additional group.
- canBePostGroup() : bool
- Returns whether the given group can be changed to a post-count based group.
- canBePrimary() : bool
- Returns whether the given group can be a primary group.
- canBeProtected() : bool
- Returns whether the given group can be changed to a protected group.
- canChangePermissions() : bool
- Returns whether the permissions of the given group can be changed.
- canChangeType() : bool
- Returns whether the type of the given group can be changed.
- canDelete() : bool
- Returns whether the given group can be deleted.
- canLeave() : bool
- Returns whether users can choose to leave the given group.
- canSearch() : bool
- Returns whether people can search for members of this group.
- formatIcons() : bool
- Returns the icons formatted for display.
- getHelpTxt() : string
- Returns the Lang::$helptxt key for the given group.
- getHref() : string
- Returns the URL for an overview of the given group.
- getLink() : string
- Returns an HTML link to an overview of the given group.
- isAssignable() : bool
- Returns whether the given group can be assigned to a member.
- isModeratorGroup() : bool
- Returns whether the given group moderates any boards.
- isPostGroup() : bool
- Returns whether the given group is a post-count based group.
- isProtected() : bool
- Returns whether the given group is a protected group.
- queryData() : Generator<string|int, array<string|int, mixed>>
- Generator that runs queries about group data and yields the result rows.
Constants
ADMIN
public
mixed
ADMIN
= 1
GLOBAL_MOD
public
mixed
GLOBAL_MOD
= 2
GUEST
public
mixed
GUEST
= -1
INVISIBLE
public
mixed
INVISIBLE
= 2
LOAD_BOTH
public
mixed
LOAD_BOTH
= 3
LOAD_NORMAL
public
mixed
LOAD_NORMAL
= 1
LOAD_POST
public
mixed
LOAD_POST
= 2
MOD
public
mixed
MOD
= 3
NEWBIE
public
mixed
NEWBIE
= 4
NO_GROUP_KEY
public
mixed
NO_GROUP_KEY
= 1
NONE
public
mixed
NONE
= -2
REGULAR
public
mixed
REGULAR
= 0
TYPE_FREE
public
mixed
TYPE_FREE
= 3
TYPE_PRIVATE
public
mixed
TYPE_PRIVATE
= 0
TYPE_PROTECTED
public
mixed
TYPE_PROTECTED
= 1
TYPE_REQUESTABLE
public
mixed
TYPE_REQUESTABLE
= 2
VISIBLE
public
mixed
VISIBLE
= 0
Properties
$boards_can_moderate
public
array<string|int, mixed>
$boards_can_moderate
IDs of boards that this group can moderate.
$can_moderate
public
bool
$can_moderate
= false
Whether the current user can moderate this group.
$children
public
array<string|int, mixed>
$children
Groups that inherit permissions from this group.
Keys are IDs, values are names.
$description
public
string
$description
The group's description.
$hidden
public
int
$hidden
= self::VISIBLE
Determines this group's (lack of) visibility.
Possible values are: self::VISIBLE => Visible. self::NO_GROUP_KEY => Hidden in group key, but otherwise visible. self::INVISIBLE => Invisible.
$icon_count
public
int
$icon_count
= 0
The number of icons to show.
$icon_image
public
string
$icon_image
= ''
The icon image.
$id
public
int
$id
The group's ID number.
$loaded
public
static array<string|int, mixed>
$loaded
= []
All loaded instances of this class.
$max_messages
public
int
$max_messages
= 0
How many personal messages members of this group can have in their inbox.
$members
public
array<string|int, mixed>
$members
IDs of members who are in this group.
$min_posts
public
int
$min_posts
How many posts are required to be in this group.
Always -1 for groups that are not based on post count.
$moderator_ids
public
array<string|int, mixed>
$moderator_ids
IDs of members who can moderate this group.
$moderators
public
array<string|int, mixed>
$moderators
= []
Members who can moderate this group, formatted for display. Items in this array take different forms in different cases.
$name
public
string
$name
The group's name.
$num_members
public
int
$num_members
How many members are in this group.
$num_permissions
public
array<string|int, mixed>
$num_permissions
= ['allowed' => 0, 'denied' => 0]
The numbers of allowed and denied permissions that this group has.
Contains two sub-arrays, 'allowed' and 'denied'.
This is typically only used by SMF\Actions\Admin\Permissions.
$online_color
public
string
$online_color
= ''
The group's color.
$parent
public
int
$parent
= self::NONE
ID of the group from which this group inherits permissions.
self::NONE means it does not inherit any permissions.
$permissions
public
array<string|int, mixed>
$permissions
= ['general' => [], 'board_profiles' => []]
Permissions that this group has.
Contains two sub-arrays, 'general' and 'board_profiles'.
General permissions are listed as key-value pairs where the keys are permission names and values are integers.
Board permissions are listed with the keys being permission profile IDs, the values being sub-arrays containing key-value pairs similar to what is used for the general permissions.
As in the database table itself, 0 means denied and 1 means allowed. A permission that is not listed at all is neither granted nor denied.
$raw_icons
public
string
$raw_icons
= ''
The group's icons, as stored in the database.
$tfa_required
public
bool
$tfa_required
= false
Whether members of this group are required to use two factor authentication.
$type
public
int
$type
Determines who can add members to this group.
Possible values are one of this class's TYPE_* constants: TYPE_PRIVATE => Only users with the manage_membergroups permission can add members. TYPE_PROTECTED => Only administrators can add members. TYPE_REQUESTABLE => Users may request to join, but the group moderator must approve the request before the user is added. TYPE_FREE => Users can join and leave at will.
Note that post-based groups are internally stored as type 0, but in fact the type value is ignored for them.
$post_groups
protected
static array<string|int, mixed>
$post_groups
IDs of all post-count based groups.
$prop_aliases
protected
array<string|int, mixed>
$prop_aliases
= ['id_group' => 'id', 'group_name' => 'name', 'editable_name' => 'name', 'group_type' => 'type', 'id_parent' => 'parent', 'inherited_from' => 'parent', 'desc' => 'description', 'color' => 'online_color', 'member_count' => 'num_members', 'protected' => __CLASS__ . '::isProtected', 'is_protected' => __CLASS__ . '::isProtected', 'is_post_group' => __CLASS__ . '::isPostGroup', 'is_postgroup' => __CLASS__ . '::isPostGroup', 'is_moderator_group' => __CLASS__ . '::isModeratorGroup', 'assignable' => __CLASS__ . '::isAssignable', 'is_assignable' => __CLASS__ . '::isAssignable', 'allow_post_group' => __CLASS__ . '::canBePostGroup', 'allow_protected' => __CLASS__ . '::canBeProtected', 'allow_delete' => __CLASS__ . '::canDelete', 'allow_modify' => __CLASS__ . '::canChangePermissions', 'can_be_post_group' => __CLASS__ . '::canBePostGroup', 'can_be_protected' => __CLASS__ . '::canBeProtected', 'can_be_additional' => __CLASS__ . '::canBeAdditional', 'can_be_primary' => __CLASS__ . '::canBePrimary', 'can_change_type' => __CLASS__ . '::canChangePermissions', 'can_change_permissions' => __CLASS__ . '::canChangePermissions', 'can_delete' => __CLASS__ . '::canDelete', 'can_search' => __CLASS__ . '::canSearch', 'can_leave' => __CLASS__ . '::canLeave', 'icons' => __CLASS__ . '::formatIcons', 'help' => __CLASS__ . '::getHelpTxt', 'href' => __CLASS__ . '::getHref', 'link' => __CLASS__ . '::getLink']
Alternate names for some object properties.
$unassignable
protected
static array<string|int, mixed>
$unassignable
IDs of groups that the current user cannot assign.
Methods
__construct()
Constructor.
public
__construct(int $id[, array<string|int, mixed> $props = [] ]) : mixed
Parameters
- $id : int
-
The ID number of the group.
- $props : array<string|int, mixed> = []
-
Properties to set for this group. If empty, will be loaded from the database automatically.
__set()
Sets custom properties.
public
__set(string $prop, mixed $value) : void
Parameters
- $prop : string
-
The property name.
- $value : mixed
-
The value to set.
addMembers()
Adds members to this group.
public
addMembers(int|array<string|int, mixed> $members[, string $type = 'auto' ][, bool $perms_checked = false ][, bool $ignore_protected = false ]) : bool
Requires the manage_membergroups permission. Function has protection against adding members to implicit groups. Non-admins are not able to add members to the admin group.
Parameters
- $members : int|array<string|int, mixed>
-
The IDs of one or more members.
- $type : string = 'auto'
-
Specifies whether the group is added as primary or as an additional group.
Supported types:
only_primary Assigns a group as primary group, but only if a member has not yet a primary group assigned, unless the member is already part of the group.
only_additional Assigns a group to the additional groups, unless the member is already part of the group.
force_primary Assigns a group as primary no matter what the previous primary group was.
auto Assigns a group as primary if primary is still available. If not, assign it to the additional group.
- $perms_checked : bool = false
-
Whether we've already checked permissions.
- $ignore_protected : bool = false
-
Whether to ignore the protected status of protected groups.
Return values
bool —Whether the operation was successful.
countMembers()
Counts how many members are in this group.
public
countMembers([bool $recount = false ]) : int
Results are saved in $this->num_members and also returned.
Parameters
- $recount : bool = false
-
If true, force a recount.
Return values
int —Number of members in this group.
countMembersBatch()
Like $this->countMembers(), except that this is more efficient when working on a batch of groups.
public
static countMembersBatch(array<string|int, mixed> $group_ids[, bool $recount = false ]) : array<string|int, mixed>
Groups that have not already been loaded will be skipped.
Results are saved in $this->num_members for each group and also returned.
Parameters
- $group_ids : array<string|int, mixed>
-
IDs of the groups to count.
- $recount : bool = false
-
If true, force a recount.
Return values
array<string|int, mixed> —Numbers of members in each group.
countPermissions()
Counts the allowed and denied permissions for this group.
public
countPermissions([int $profile = null ]) : array<string|int, mixed>
Results are saved in $this->num_permissions and also returned.
Parameters
- $profile : int = null
-
Which permissions profile to get permissions for. If set to 1 or higher, get permissions for that permissions profile. If set to 0, get general permissions. If null, get all permissions.
Return values
array<string|int, mixed> —A copy of $this->num_permissions.
countPermissionsBatch()
Like $this->countPermissions(), except that this is more efficient when working on a batch of groups.
public
static countPermissionsBatch(array<string|int, mixed> $group_ids[, int $profile = null ]) : array<string|int, mixed>
Groups that have not already been loaded will be skipped.
Results are saved in $this->num_permissions for each group and also returned.
Parameters
- $group_ids : array<string|int, mixed>
-
IDs of the groups to count permissions for.
- $profile : int = null
-
Which permissions profile to count permissions for. If set to 1 or higher, count permissions for that permissions profile. If set to 0, count general permissions only. If null, count general permissions and the default profile.
Return values
array<string|int, mixed> —Copies of $this->num_permissions for all the groups.
delete()
Deletes this group.
public
delete() : bool|string
Return values
bool|string —True for success, otherwise an identifier as to reason for failure
fixMembership()
Ensures membership is correct for post groups, hidden groups, and the moderator group.
public
fixMembership() : void
Called by the save() method, but can also be called directly.
getBoardsCanModerate()
Loads the IDs of any boards that this group can moderate.
public
getBoardsCanModerate() : array<string|int, mixed>
Results are saved in $this->boards_can_moderate and also returned.
Return values
array<string|int, mixed> —A copy of $this->boards_can_moderate.
getCachedList()
Retrieve a list of (visible) membergroups used by the cache.
public
static getCachedList() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array of information about the cached value.
getChildren()
Loads the IDs and names of groups that inherit permissions from this group.
public
getChildren() : array<string|int, mixed>
Results are saved in $this->children and also returned.
Return values
array<string|int, mixed> —A copy of $this->children.
getPostGroups()
Returns the IDs of all post-count based groups.
public
static getPostGroups() : array<string|int, mixed>
Return values
array<string|int, mixed> —IDs of all post-count based groups
getUnassignable()
Populates self::$unassignable with the IDs of any groups that the current user cannot assign.
public
static getUnassignable() : array<string|int, mixed>
Return values
array<string|int, mixed> —A copy of self::$unassignable
load()
Loads groups by ID number and/or by custom query.
public
static load([array<string|int, mixed>|int $ids = [] ][, array<string|int, mixed> $query_customizations = [] ]) : array<string|int, mixed>
Parameters
- $ids : array<string|int, mixed>|int = []
-
The ID numbers of zero or more groups.
- $query_customizations : array<string|int, mixed> = []
-
Customizations to the SQL query.
Return values
array<string|int, mixed> —Instances of this class for the loaded groups.
loadAssignable()
Loads groups that the current user can assign people to.
public
static loadAssignable() : array<string|int, mixed>
Return values
array<string|int, mixed> —Instances of this class for the loaded groups.
loadMembers()
Loads the IDs of all the members of this group.
public
loadMembers() : array<string|int, mixed>
Results are saved in $this->members and also returned.
Return values
array<string|int, mixed> —IDs of members in this group.
loadModerators()
Loads the IDs of the moderators of this group.
public
loadModerators([bool $ignore_protected = false ]) : void
Results are saved in $this->moderator_ids.
Parameters
- $ignore_protected : bool = false
-
Whether to ignore the protected status of protected groups.
loadModeratorsBatch()
Like $this->loadModerators(), except that this is more efficient when working on a batch of groups.
public
static loadModeratorsBatch(array<string|int, mixed> $group_ids[, bool $ignore_protected = false ]) : void
Groups that have not already been loaded will be skipped.
Results are saved in $this->moderator_ids for each group.
Parameters
- $group_ids : array<string|int, mixed>
-
IDs of some groups.
- $ignore_protected : bool = false
-
Whether to ignore the protected status of protected groups.
loadPermissions()
Loads the permissions for this group.
public
loadPermissions([int $profile = null ][, bool $reload = false ]) : array<string|int, mixed>
Results are saved in $this->permissions and also returned.
Parameters
- $profile : int = null
-
Which permissions profile to get permissions for. If set to 1 or higher, get permissions for that permissions profile. If set to 0, get general permissions. If null, get all permissions.
- $reload : bool = false
-
If true, force a reload from the database.
Return values
array<string|int, mixed> —A copy of $this->permissions.
loadPermissionsBatch()
Like $this->loadPermissions(), except that this is more efficient when working on a batch of groups.
public
static loadPermissionsBatch(array<string|int, mixed> $group_ids[, int $profile = null ][, bool $reload = false ]) : array<string|int, mixed>
Groups that have not already been loaded will be skipped.
Results are saved in $this->permissions for each group and also returned.
Parameters
- $group_ids : array<string|int, mixed>
-
IDs of the groups to get permissions for.
- $profile : int = null
-
Which permissions profile to get permissions for. If set to 1 or higher, get permissions for that permissions profile. If set to 0, get general permissions only. If null, get all permissions.
- $reload : bool = false
-
If true, force a reload from the database.
Return values
array<string|int, mixed> —Copies of $this->permissions for all the groups.
loadSimple()
Convenience method to load specific sorts of groups.
public
static loadSimple([int $include = self::LOAD_NORMAL ][, array<string|int, mixed> $exclude = [self::GUEST, self::REGULAR, self::MOD] ]) : array<string|int, mixed>
If given no arguments, will load all the normal groups (meaning, the ones that have an ID greater than zero, are not post-count based, and are not the special moderators group).
Parameters
- $include : int = self::LOAD_NORMAL
-
One of this class's LOAD_* constants.
- $exclude : array<string|int, mixed> = [self::GUEST, self::REGULAR, self::MOD]
-
IDs of groups to exclude.
Return values
array<string|int, mixed> —Instances of this class for the loaded groups.
offsetExists()
Checks whether a property has been set when object is accessed as an array.
public
offsetExists(mixed $prop) : bool
Parameters
- $prop : mixed
-
The property name.
Return values
booloffsetGet()
Gets properties when object is accessed as an array.
public
& offsetGet(mixed $prop) : mixed
Parameters
- $prop : mixed
-
The property name.
Return values
mixed —A reference to the property.
offsetSet()
Sets properties when object is accessed as an array.
public
offsetSet(mixed $prop, mixed $value) : void
Parameters
- $prop : mixed
-
The property name.
- $value : mixed
-
The value to set.
offsetUnset()
Unsets properties when object is accessed as an array.
public
offsetUnset(mixed $prop) : void
Parameters
- $prop : mixed
-
The property name.
removeMembers()
Remove one or more members from one or more membergroups.
public
removeMembers(int|array<string|int, mixed> $members[, bool $perms_checked = false ][, bool $ignore_protected = false ]) : bool
Requires the manage_membergroups permission. Function includes a protection against removing from implicit groups. Non-admins are not able to remove members from the admin group.
Parameters
- $members : int|array<string|int, mixed>
-
The ID of a member or an array of member IDs.
- $perms_checked : bool = false
-
Whether we've already checked permissions.
- $ignore_protected : bool = false
-
Whether to ignore the protected status of protected groups.
Return values
bool —Whether the operation was successful.
save()
Saves this group to the database.
public
save() : void
updateBoardAccess()
Updates the boards this group has access to.
public
updateBoardAccess(array<string|int, mixed> $board_access) : void
Parameters
- $board_access : array<string|int, mixed>
canBeAdditional()
Returns whether the given group can be an additional group.
protected
static canBeAdditional(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can become an additional group.
canBePostGroup()
Returns whether the given group can be changed to a post-count based group.
protected
static canBePostGroup(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can changed to a post-count based group.
canBePrimary()
Returns whether the given group can be a primary group.
protected
static canBePrimary(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can become a primary group.
canBeProtected()
Returns whether the given group can be changed to a protected group.
protected
static canBeProtected(self $group) : bool
The answer is always no unless the current user is an admin.
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can become a protected group.
canChangePermissions()
Returns whether the permissions of the given group can be changed.
protected
static canChangePermissions(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can be deleted.
canChangeType()
Returns whether the type of the given group can be changed.
protected
static canChangeType(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can be deleted.
canDelete()
Returns whether the given group can be deleted.
protected
static canDelete(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can be deleted.
canLeave()
Returns whether users can choose to leave the given group.
protected
static canLeave(self $group) : bool
Specifically, users can't leave a private or protected group. For example, if the admin added you to a group for miscreants with reduced privileges, you can't just decide to leave it.
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can become an additional group.
canSearch()
Returns whether people can search for members of this group.
protected
static canSearch(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can be deleted.
formatIcons()
Returns the icons formatted for display.
protected
static formatIcons(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group is a post-count based group.
getHelpTxt()
Returns the Lang::$helptxt key for the given group.
protected
static getHelpTxt(self $group) : string
Parameters
- $group : self
-
An instance of this class.
Return values
string —The Lang::$helptxt key for this group.
getHref()
Returns the URL for an overview of the given group.
protected
static getHref(self $group) : string
Parameters
- $group : self
-
An instance of this class.
Return values
string —The URL for the group.
getLink()
Returns an HTML link to an overview of the given group.
protected
static getLink(self $group) : string
Parameters
- $group : self
-
An instance of this class.
Return values
string —The HTML link.
isAssignable()
Returns whether the given group can be assigned to a member.
protected
static isAssignable(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group can be assigned to a member.
isModeratorGroup()
Returns whether the given group moderates any boards.
protected
static isModeratorGroup(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group moderates any boards.
isPostGroup()
Returns whether the given group is a post-count based group.
protected
static isPostGroup(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group is a post-count based group.
isProtected()
Returns whether the given group is a protected group.
protected
static isProtected(self $group) : bool
Parameters
- $group : self
-
An instance of this class.
Return values
bool —Whether the group is a protected group.
queryData()
Generator that runs queries about group data and yields the result rows.
protected
static queryData(array<string|int, mixed> $selects[, array<string|int, mixed> $params = [] ][, array<string|int, mixed> $joins = [] ][, array<string|int, mixed> $where = [] ][, array<string|int, mixed> $order = [] ][, array<string|int, mixed> $group = [] ][, int|string $limit = 0 ]) : Generator<string|int, array<string|int, mixed>>
Parameters
- $selects : array<string|int, mixed>
-
Table columns to select.
- $params : array<string|int, mixed> = []
-
Parameters to substitute into query text.
- $joins : array<string|int, mixed> = []
-
Zero or more complete JOIN clauses. E.g.: 'LEFT JOIN {db_prefix}categories AS c ON (c.id_cat = b.id_cat)' Note that 'FROM {db_prefix}membergroups AS mg' is always part of the query.
- $where : array<string|int, mixed> = []
-
Zero or more conditions for the WHERE clause. Conditions will be placed in parentheses and concatenated with AND. If this is left empty, no WHERE clause will be used.
- $order : array<string|int, mixed> = []
-
Zero or more conditions for the ORDER BY clause. If this is left empty, no ORDER BY clause will be used.
- $group : array<string|int, mixed> = []
-
Zero or more conditions for the GROUP BY clause. If this is left empty, no GROUP BY clause will be used.
- $limit : int|string = 0
-
Maximum number of results to retrieve. If this is left empty, all results will be retrieved.
Return values
Generator<string|int, array<string|int, mixed>> —Iterating over the result gives database rows.