[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

BuddyPress Nonmember Opt-out Class

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

Defines 1 class

BP_Optout:: (17 methods):
  __construct()
  get_table_name()
  save()
  populate()
  _insert()
  _update()
  _delete()
  get_where_sql()
  get_order_by_sql()
  get_paged_sql()
  get_query_clauses()
  get()
  get_total_count()
  update()
  delete()
  optout_exists()
  delete_by_id()


Class: BP_Optout  - X-Ref

BuddyPress opt-outs.

Use this class to create, access, edit, or delete BuddyPress Nonmember Opt-outs.

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

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

get_table_name()   X-Ref
Get the opt-outs table name.

since: 8.0.0
return: string

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

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

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

since: 8.0.0

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

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

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

param: array $data         Array of opt-out 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: 8.0.0
return: int|false The number of rows updated, or false on error.

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

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

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

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

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

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

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

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

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

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

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

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,
'email_type' => 'type_string',
);

This will be converted to:

array(
'data' => array(
'user_id' => 4,
'email_type'   => 'type_string',
),
'format' => array(
'%d',
'%s',
),
)

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

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

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

param: array $args {
since: 8.0.0
return: array BP_Optout objects | IDs of found opt-outs | Email addresses of matches.

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

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

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

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

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

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

optout_exists( $args = array()   X-Ref
Check whether an invitation exists matching the passed arguments.

since: 5.0.0
return: int|bool ID of first found invitation or false if none found.

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

param: int $id ID of the opt-out item to be deleted.
since: 8.0.0
return: bool True on success, false on failure.



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