[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

BuddyPress Groups Classes.

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

Defines 1 class

BP_Group_Member_Query:: (6 methods):
  setup_hooks()
  get_include_ids()
  get_group_member_ids()
  set_orderby()
  populate_group_member_extras()
  get_gm_ids_ordered_by_activity()


Class: BP_Group_Member_Query  - X-Ref

Query for the members of a group.

Special notes about the group members data schema:
- *Members* are entries with is_confirmed = 1.
- *Pending requests* are entries with is_confirmed = 0 and inviter_id = 0.
- *Pending and sent invitations* are entries with is_confirmed = 0 and
inviter_id != 0 and invite_sent = 1.
- *Pending and unsent invitations* are entries with is_confirmed = 0 and
inviter_id != 0 and invite_sent = 0.
- *Membership requests* are entries with is_confirmed = 0 and
inviter_id = 0 (and invite_sent = 0).

setup_hooks()   X-Ref
Set up action hooks.

since: 1.8.0

get_include_ids( $include = array()   X-Ref
Get a list of user_ids to include in the IN clause of the main query.

Overrides BP_User_Query::get_include_ids(), adding our additional
group-member logic.

return: array
param: array $include Existing group IDs in the $include parameter,
since: 1.8.0

get_group_member_ids()   X-Ref
Get the members of the queried group.

return: array $ids User IDs of relevant group member ids.
since: 1.8.0

set_orderby( $query )   X-Ref
Tell BP_User_Query to order by the order of our query results.

We only override BP_User_Query's native ordering in case of the
'last_joined' and 'first_joined' $type parameters.

param: BP_User_Query $query BP_User_Query object.
since: 1.8.1

populate_group_member_extras( $query, $user_ids_sql )   X-Ref
Fetch additional data required in bp_group_has_members() loops.

Additional data fetched:
- is_banned
- date_modified

param: BP_User_Query $query        BP_User_Query object. Because we're
param: string        $user_ids_sql Sanitized, comma-separated string of
since: 1.8.0

get_gm_ids_ordered_by_activity( $query, $gm_ids = array()   X-Ref
Sort user IDs by how recently they have generated activity within a given group.

return: array
param: BP_User_Query $query  BP_User_Query object.
param: array         $gm_ids array of group member ids.
since: 2.1.0



Generated: Fri Jul 19 01:01:43 2019 Cross-referenced by PHPXref 0.7.1