[ 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.

since: 1.6.0
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

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

since: 1.6.0

__get( $key )   X-Ref
Magic getter.

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

__isset( $key )   X-Ref
Magic issetter.

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

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.

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

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.

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

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

since: 1.8.0
return: bool|int True on success, false on failure.
param: int $group_id ID of the group.

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

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

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.

since: 1.6.0
return: array {
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.

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.

since: 1.6.0
return: array {
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

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.

since: 1.6.0
return: array {
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

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.

since: 1.6.0
return: array {
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

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.

since: 2.4.0
return: array {
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

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

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

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

since: 1.6.0
return: array {
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

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

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

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

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

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

since: 1.6.0
return: int|null The ID of the invitation if found; null if not found.
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

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

since: 1.6.0
return: int Number of records deleted.
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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

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

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

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

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

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

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

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

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

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

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

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

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

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

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.

return: false|array
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.

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

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

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

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

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.

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



Generated: Thu Sep 19 01:01:39 2019 Cross-referenced by PHPXref 0.7.1