[ Index ]

PHP Cross Reference of BuddyPress

title

Body

[close]

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

Core component classes.

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

Defines 3 functions

  get_sql_clauses()
  get_sql_for_query()
  sanitize_query()

Functions
Functions that are not part of a class:

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

Extending classes should call this method from within a publicly
accessible get_sql() method, and manipulate the SQL as necessary.
For example, {@link BP_XProfile_Query::get_sql()} is merely a wrapper for
get_sql_clauses(), while {@link BP_Activity_Query::get_sql()} discards
the empty 'join' clause, and only passes the 'where' clause.

return: array
since: 2.2.0

get_sql_for_query( $query, $depth = 0 )   X-Ref
Generate SQL clauses for a single query array.

If nested subqueries are found, this method recurses the tree to
produce the properly nested SQL.

Subclasses generally do not need to call this method. It is invoked
automatically from get_sql_clauses().

return: array
param: array $query Query to parse.
param: int   $depth Optional. Number of tree levels deep we
since: 2.2.0

sanitize_query( $queries )   X-Ref
Recursive-friendly query sanitizer.

Ensures that each query-level clause has a 'relation' key, and that
each first-order clause contains all the necessary keys from
$defaults.

Extend this method if your class uses different sanitizing logic.

return: array Sanitized array of query clauses.
param: array $queries Array of query clauses.
since: 2.2.0



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