[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-core/classes/ -> class-bp-invitation.php (summary)

BuddyPress Invitation Class

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

Defines 1 class

BP_Invitation:: (19 methods):
  __construct()
  save()
  populate()
  _insert()
  _update()
  _delete()
  get_where_sql()
  get_order_by_sql()
  get_paged_sql()
  get_query_clauses()
  get()
  get_total_count()
  update()
  delete()
  delete_by_id()
  mark_sent()
  mark_sent_by_data()
  mark_accepted()
  mark_accepted_by_data()


Class: BP_Invitation  - X-Ref

BuddyPress Invitations.

Use this class to create, access, edit, or delete BuddyPress Invitations.

__construct( $id = 0 )   X-Ref
Constructor method.

param: int $id Optional. Provide an ID to access an existing
since: 5.0.0

save()   X-Ref
Update or insert invitation details into the database.

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

populate()   X-Ref
Fetch data for an existing invitation from the database.

since: 5.0.0

_insert( $data = array()   X-Ref
Create an invitation entry.

return: int|false The number of rows inserted, or false on error.
param: array $data {
param: array $data_format See {@link wpdb::insert()}.
since: 5.0.0

_update( $data = array()   X-Ref
Update invitations.

return: int|false The number of rows updated, or false on error.
param: array $data         Array of invitation data to update, passed to
param: array $where        The WHERE params as passed to wpdb::update().
param: array $data_format  See {@link wpdb::insert()}.
param: array $where_format See {@link wpdb::insert()}.
since: 5.0.0

_delete( $where = array()   X-Ref
Delete invitations.

return: int|false The number of rows updated, or false on error.
param: array $where        Array of WHERE clauses to filter by, passed to
param: array $where_format See {@link wpdb::insert()}.
since: 5.0.0

get_where_sql( $args = array()   X-Ref
Assemble the WHERE clause of a get() SQL statement.

Used by BP_Invitation::get() to create its WHERE
clause.

return: string WHERE clause.
param: array $args See {@link BP_Invitation::get()} for more details.
since: 5.0.0

get_order_by_sql( $args = array()   X-Ref
Assemble the ORDER BY clause of a get() SQL statement.

Used by BP_Invitation::get() to create its ORDER BY
clause.

return: string ORDER BY clause.
param: array $args See {@link BP_Invitation::get()} for more details.
since: 5.0.0

get_paged_sql( $args = array()   X-Ref
Assemble the LIMIT clause of a get() SQL statement.

Used by BP_Invitation::get() to create its LIMIT clause.

return: string LIMIT clause.
param: array $args See {@link BP_Invitation::get()} for more details.
since: 5.0.0

get_query_clauses( $args = array()   X-Ref
Assemble query clauses, based on arguments, to pass to $wpdb methods.

The insert(), update(), and delete() methods of {@link wpdb} expect
arguments of the following forms:

- associative arrays whose key/value pairs are column => value, to
be used in WHERE, SET, or VALUES clauses
- arrays of "formats", which tell $wpdb->prepare() which type of
value to expect when sanitizing (eg, array( '%s', '%d' ))

This utility method can be used to assemble both kinds of params,
out of a single set of associative array arguments, such as:

$args = array(
'user_id' => 4,
'class'   => 'BP_Groups_Invitation_Manager',
);

This will be converted to:

array(
'data' => array(
'user_id' => 4,
'class'   => 'BP_Groups_Invitation_Manager',
),
'format' => array(
'%d',
'%s',
),
)

which can easily be passed as arguments to the $wpdb methods.

return: array Associative array of 'data' and 'format' args.
param: array $args Associative array of filter arguments.
since: 5.0.0

get( $args = array()   X-Ref
Get invitations, based on provided filter parameters.

return: array BP_Invitation objects | IDs of found invite.
param: array $args {
since: 5.0.0

get_total_count( $args )   X-Ref
Get a count of total invitations matching a set of arguments.

return: int Count of located items.
param: array $args See {@link BP_Invitation::get()}.
since: 5.0.0

update( $update_args = array()   X-Ref
Update invitations.

return: int|bool Number of rows updated on success, false on failure.
param: array $update_args Associative array of fields to update,
param: array $where_args  Associative array of columns/values, to
since: 5.0.0

delete( $args = array()   X-Ref
Delete invitations.

return: int|bool Number of rows deleted on success, false on failure.
param: array $args Associative array of columns/values, to determine
since: 5.0.0

delete_by_id( $id )   X-Ref
Delete a single invitation by ID.

return: bool True on success, false on failure.
param: int $id ID of the invitation item to be deleted.
since: 5.0.0

mark_sent( $id = 0, $args = array()   X-Ref
Mark specific invitations as sent by invitation ID.

return: int|bool The number of rows updated, or false on error.
param: int   $id   The ID of the invitation to mark as sent.
param: array $args {
since: 5.0.0

mark_sent_by_data( $args )   X-Ref
Mark invitations as sent that are found by user_id, inviter_id, item id, and optional
secondary item id, and class name.

return: int|bool The number of rows updated, or false on error.
param: array $args See BP_Invitation::update().
since: 5.0.0

mark_accepted( $id = 0, $args = array()   X-Ref
Mark specific invitations as accepted by invitation ID.

return: int|bool The number of rows updated, or false on error.
param: int   $id   The ID of the invitation to mark as sent.
param: array $args {
since: 5.0.0

mark_accepted_by_data( $args )   X-Ref
Mark invitations as accepted that are found by user_id, inviter_id,
item id, and optional secondary item id, and class name.

return: int|bool The number of rows updated, or false on error.
param: array $args See BP_Invitation::update().
since: 5.0.0



Generated: Thu Nov 21 01:00:57 2024 Cross-referenced by PHPXref 0.7.1