[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

Core component classes.

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

Defines 1 class

BP_Date_Query:: (5 methods):
  __construct()
  __destruct()
  register_date_column()
  get_sql_clauses()
  get_where_sql()


Class: BP_Date_Query  - X-Ref

BuddyPress date query class.

Extends the {@link WP_Date_Query} class for use with BuddyPress.

__construct( $date_query, $column = '', $prepend_and = false )   X-Ref
Constructor.

param: array  $date_query  Date query arguments.
param: string $column      The DB column to query against.
param: bool   $prepend_and Whether to prepend the 'AND' operator to the WHERE SQL clause.
since: 2.1.0
since: 10.0.0 Added $prepend_and argument.

__destruct()   X-Ref
Destructor.


register_date_column( $retval = array()   X-Ref
Registers our date column with WP Date Query to pass validation.

param: array $retval Current DB columns.
return: array

get_sql_clauses()   X-Ref
Generate SQL clauses to be appended to a main query.

Since BuddyPress builds its SQL queries differently than WP_Query, we have
to override the parent method to remove the leading 'AND' operator from the
WHERE clause.

return: array {
since: 10.0.0

get_where_sql( $date_query = array()   X-Ref
Helper method to generate and fetch the WHERE SQL clause for a date query.

See {@link BP_Date_Query::__construct()} for all argument documentation.

param: array  $date_query  Date query arguments.
param: string $column      DB column to query against date.
param: bool   $prepend_and Whether to prepend the 'AND' operator to the WHERE clause.
return: string
since: 10.0.0



Generated: Thu Dec 26 01:01:04 2024 Cross-referenced by PHPXref 0.7.1