[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

/src/bp-xprofile/classes/ -> class-bp-xprofile-meta-query.php (summary)

BuddyPress XProfile Classes.

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

Defines 1 class

BP_XProfile_Meta_Query:: (4 methods):
  is_first_order_clause()
  parse_query_vars()
  get_sql()
  get_sql_for_clause()


Class: BP_XProfile_Meta_Query  - X-Ref

Class for generating SQL clauses that filter a primary query according to
XProfile metadata keys and values.

`BP_XProfile_Meta_Query` is a helper that allows primary query classes, such
as {@see WP_Query} and {@see WP_User_Query}, to filter their results by object
metadata, by generating `JOIN` and `WHERE` subclauses to be attached
to the primary SQL query string.

is_first_order_clause( $query )   X-Ref
Determine whether a query clause is first-order.

A first-order meta query clause is one that has either a 'key', 'value',
or 'object' array key.

param: array $query Meta query arguments.
since: 2.3.0
return: bool Whether the query clause is a first-order clause.

parse_query_vars( $qv )   X-Ref
Constructs a meta query based on 'meta_*' query vars.

param: array $qv The query variables.
since: 2.3.0

get_sql( $type, $primary_table, $primary_id_column, $context = null )   X-Ref
Generates SQL clauses to be appended to a main query.

param: string      $type              Type of meta, eg 'user', 'post'.
param: string      $primary_table     Database table where the object being filtered is stored (eg wp_users).
param: string      $primary_id_column ID column for the filtered object in $primary_table.
param: object|null $context           Optional. The main query object.
since: 2.3.0
return: array {

get_sql_for_clause( &$clause, $parent_query, $clause_key = '' )   X-Ref
Generate SQL JOIN and WHERE clauses for a first-order query clause.

"First-order" means that it's an array with a 'key' or 'value'.

param: array  $clause       Query clause, passed by reference.
param: array  $parent_query Parent query array.
param: string $clause_key   Optional. The array key used to name the clause in the original `$meta_query`
since: 2.3.0
return: array {



Generated: Sat Apr 27 01:00:55 2024 Cross-referenced by PHPXref 0.7.1