[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-groups/classes/ -> class-bp-groups-member.php (summary)

BuddyPress Groups Classes.

File Size: 1414 lines (48 kb)
Included or required:0 times
Referenced: 0 times
Includes or requires: 0 files

Defines 1 class

BP_Groups_Member:: (45 methods):
  __construct()
  populate()
  __get()
  __isset()
  get_user_object()
  save()
  promote()
  demote()
  ban()
  unban()
  accept_invite()
  accept_request()
  remove()
  refresh_total_group_count_for_user()
  refresh_total_member_count_for_group()
  delete()
  get_group_ids()
  get_recently_joined()
  get_is_admin_of()
  get_is_mod_of()
  get_is_banned_of()
  total_group_count()
  get_invites()
  get_invite_count_for_user()
  get_user_memberships()
  check_has_invite()
  delete_invite()
  delete_request()
  check_is_admin()
  check_is_mod()
  check_is_member()
  check_is_banned()
  check_is_creator()
  check_for_membership_request()
  get_random_groups()
  get_group_member_ids()
  get_group_administrator_ids()
  prime_group_admins_mods_cache()
  get_group_moderator_ids()
  get_memberships_by_id()
  get_all_membership_request_user_ids()
  get_all_for_group()
  get_membership_ids_for_user()
  delete_all()
  delete_all_for_user()


Class: BP_Groups_Member  - X-Ref

BuddyPress Group Membership object.

__construct( $user_id = 0, $group_id = 0, $id = false, $populate = true )   X-Ref
Constructor method.

param: int      $user_id  Optional. Along with $group_id, can be used to
param: int      $group_id Optional. Along with $user_id, can be used to
param: int|bool $id       Optional. The unique ID of the membership object.
param: bool     $populate Whether to populate the properties of the
since: 1.6.0

populate()   X-Ref
Populate the object's properties.

since: 1.6.0

__get( $key )   X-Ref
Magic getter.

param: string $key Key.
since: 2.8.0
return: BP_Core_User|null

__isset( $key )   X-Ref
Magic issetter.

param: string $key Key.
since: 2.8.0
return: bool

get_user_object()   X-Ref
Get the user object corresponding to this membership.

Used for lazyloading the protected `user` property.

since: 2.8.0
return: BP_Core_User

save()   X-Ref
Save the membership data to the database.

since: 1.6.0
return: bool True on success, false on failure.

promote( $status = 'mod' )   X-Ref
Promote a member to a new status.

param: string $status The new status. 'mod' or 'admin'.
since: 1.6.0
return: bool True on success, false on failure.

demote()   X-Ref
Demote membership to Member status (non-admin, non-mod).

since: 1.6.0
return: bool True on success, false on failure.

ban()   X-Ref
Ban the user from the group.

since: 1.6.0
return: bool True on success, false on failure.

unban()   X-Ref
Unban the user from the group.

since: 1.6.0
return: bool True on success, false on failure.

accept_invite()   X-Ref
Mark a pending invitation as accepted.

since: 1.6.0

accept_request()   X-Ref
Confirm a membership request.

since: 1.6.0

remove()   X-Ref
Remove the current membership.

since: 1.6.0
return: bool True on success, false on failure.

refresh_total_group_count_for_user( $user_id )   X-Ref
Refresh the `total_group_count` for a user.

param: int $user_id ID of the user.
since: 1.8.0

refresh_total_member_count_for_group( $group_id )   X-Ref
Refresh the `total_member_count` for a group.

The request skip the current cache so that we always grab the lastest total count.

param: int $group_id ID of the group.
since: 1.8.0
since: 10.0.0 Updated to use `BP_Groups_Group::get_total_member_count`

delete( $user_id, $group_id )   X-Ref
Delete a membership, based on user + group IDs.

param: int $user_id  ID of the user.
param: int $group_id ID of the group.
since: 1.6.0
return: bool True on success, false on failure.

get_group_ids( $user_id, $limit = false, $page = false )   X-Ref
Get the IDs of the groups of which a specified user is a member.

param: int      $user_id ID of the user.
param: int|bool $limit   Optional. Max number of results to return.
param: int|bool $page    Optional. Page offset of results to return.
since: 1.6.0
return: array {

get_recently_joined( $user_id, $limit = false, $page = false, $filter = false )   X-Ref
Get the IDs of the groups of which a specified user is a member, sorted by the date joined.

param: int         $user_id ID of the user.
param: int|bool    $limit   Optional. Max number of results to return.
param: int|bool    $page    Optional. Page offset of results to return.
param: string|bool $filter  Optional. Limit results to groups whose name or
since: 1.6.0
return: array {

get_is_admin_of( $user_id, $limit = false, $page = false, $filter = false )   X-Ref
Get the IDs of the groups of which a specified user is an admin.

param: int         $user_id ID of the user.
param: int|bool    $limit   Optional. Max number of results to return.
param: int|bool    $page    Optional. Page offset of results to return.
param: string|bool $filter  Optional. Limit results to groups whose name or
since: 1.6.0
return: array {

get_is_mod_of( $user_id, $limit = false, $page = false, $filter = false )   X-Ref
Get the IDs of the groups of which a specified user is a moderator.

param: int         $user_id ID of the user.
param: int|bool    $limit   Optional. Max number of results to return.
param: int|bool    $page    Optional. Page offset of results to return.
param: string|bool $filter  Optional. Limit results to groups whose name or
since: 1.6.0
return: array {

get_is_banned_of( $user_id, $limit = false, $page = false, $filter = false )   X-Ref
Get the groups of which a specified user is banned from.

param: int         $user_id ID of the user.
param: int|bool    $limit   Optional. Max number of results to return.
param: int|bool    $page    Optional. Page offset of results to return.
param: string|bool $filter  Optional. Limit results to groups whose name or
since: 2.4.0
return: array {

total_group_count( $user_id = 0 )   X-Ref
Get the count of groups of which the specified user is a member.

param: int $user_id Optional. Default: ID of the displayed user.
since: 1.6.0
return: int Group count.

get_invites( $user_id, $limit = false, $page = false, $exclude = false )   X-Ref
Get group objects for groups that a user is currently invited to.

param: int               $user_id ID of the invitee.
param: int|bool          $limit   Optional. Max number of results to return.
param: int|bool          $page    Optional. Page offset of results to return.
param: string|array|bool $exclude Optional. Array or comma-separated list
since: 1.6.0
return: array {

get_invite_count_for_user( $user_id = 0 )   X-Ref
Gets the total group invite count for a user.

param: int $user_id The user ID.
since: 2.0.0
return: int

get_user_memberships( $user_id, $args = array()   X-Ref
Gets memberships of a user for purposes of a personal data export.

param: int $user_id ID of the user.
param: array $args {
since: 4.0.0
return: array

check_has_invite( $user_id, $group_id, $type = 'sent' )   X-Ref
Check whether a user has an outstanding invitation to a given group.

param: int    $user_id  ID of the potential invitee.
param: int    $group_id ID of the group.
param: string $type     If 'sent', results are limited to those invitations
since: 1.6.0
return: int|null The ID of the invitation if found; null if not found.

delete_invite( $user_id, $group_id, $inviter_id = false )   X-Ref
Delete an invitation, by specifying user ID and group ID.

param: int $user_id    ID of the user.
param: int $group_id   ID of the group.
param: int $inviter_id ID of the inviter. Specify if you want to delete
since: 1.6.0
return: int Number of records deleted.

delete_request( $user_id, $group_id )   X-Ref
Delete an unconfirmed membership request, by user ID and group ID.

param: int $user_id  ID of the user.
param: int $group_id ID of the group.
since: 1.6.0
return: int Number of records deleted.

check_is_admin( $user_id, $group_id )   X-Ref
Check whether a user is an admin of a given group.

param: int $user_id  ID of the user.
param: int $group_id ID of the group.
since: 1.6.0
return: mixed

check_is_mod( $user_id, $group_id )   X-Ref
Check whether a user is a mod of a given group.

param: int $user_id  ID of the user.
param: int $group_id ID of the group.
since: 1.6.0
return: mixed

check_is_member( $user_id, $group_id )   X-Ref
Check whether a user is a member of a given group.

param: int $user_id  ID of the user.
param: int $group_id ID of the group.
since: 1.6.0
return: mixed

check_is_banned( $user_id, $group_id )   X-Ref
Check whether a user is banned from a given group.

param: int $user_id  ID of the user.
param: int $group_id ID of the group.
since: 1.6.0
return: int|null int 1 if user is banned; int 0 if user is not banned;

check_is_creator( $user_id, $group_id )   X-Ref
Is the specified user the creator of the group?

param: int $user_id  ID of the user.
param: int $group_id ID of the group.
since: 1.2.6
return: int|null int of group ID if user is the creator; null on failure.

check_for_membership_request( $user_id, $group_id )   X-Ref
Check whether a user has an outstanding membership request for a given group.

param: int $user_id  ID of the user.
param: int $group_id ID of the group.
since: 1.6.0
return: int Database ID of the membership if found; int 0 on failure.

get_random_groups( $user_id = 0, $total_groups = 5 )   X-Ref
Get a list of randomly selected IDs of groups that the member belongs to.

param: int $user_id      ID of the user.
param: int $total_groups Max number of group IDs to return. Default: 5.
since: 1.6.0
return: array Group IDs.

get_group_member_ids( $group_id )   X-Ref
Get the IDs of all a given group's members.

param: int $group_id ID of the group.
since: 1.6.0
return: array IDs of all group members.

get_group_administrator_ids( $group_id )   X-Ref
Get a list of all a given group's admins.

param: int $group_id ID of the group.
since: 1.6.0
return: array Info about group admins (user_id + date_modified).

prime_group_admins_mods_cache( $group_ids )   X-Ref
Prime the bp_group_admins cache for one or more groups.

param: array $group_ids IDs of the groups.
since: 2.7.0
return: bool True on success.

get_group_moderator_ids( $group_id )   X-Ref
Get a list of all a given group's moderators.

param: int $group_id ID of the group.
since: 1.6.0
return: array Info about group mods (user_id + date_modified).

get_memberships_by_id( $membership_ids )   X-Ref
Get group membership objects by ID (or an array of IDs).

param: int|string|array $membership_ids Single membership ID or comma-separated/array list of membership IDs.
since: 2.6.0
return: array

get_all_membership_request_user_ids( $group_id )   X-Ref
Get the IDs users with outstanding membership requests to the group.

param: int $group_id ID of the group.
since: 1.6.0
return: array IDs of users with outstanding membership requests.

get_all_for_group( $group_id, $limit = false, $page = false, $exclude_admins_mods = true, $exclude_banned = true, $exclude = false )   X-Ref
Get members of a group.

param: int        $group_id            ID of the group being queried for.
param: bool|int   $limit               Max amount to return.
param: bool|int   $page                Pagination value.
param: bool       $exclude_admins_mods Whether or not to exclude admins and moderators.
param: bool       $exclude_banned      Whether or not to exclude banned members.
param: bool|array $exclude             Array of user IDs to exclude.
return: false|array

get_membership_ids_for_user( $user_id )   X-Ref
Get all membership IDs for a user.

param: int $user_id ID of the user.
since: 2.6.0
return: array

delete_all( $group_id )   X-Ref
Delete all memberships for a given group.

param: int $group_id ID of the group.
since: 1.6.0
return: int Number of records deleted.

delete_all_for_user( $user_id )   X-Ref
Delete all group membership information for the specified user.

In cases where the user is the sole member of a group, a site administrator is
assigned to be the group's administrator. Unhook `groups_remove_data_for_user()`
to modify this behavior.

param: int $user_id ID of the user.
since: 1.0.0
since: 4.0.0 The method behavior was changed so that single-member groups are not deleted.
return: bool



Generated: Sun Dec 22 01:00:54 2024 Cross-referenced by PHPXref 0.7.1