BP_Recursive_Query::get_sql_clauses()

Generate SQL clauses to be appended to a main query.


Description Description

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


Top ↑

Return Return

(array)


Source Source

File: bp-core/classes/class-bp-recursive-query.php

	protected function get_sql_clauses() {
		$sql = $this->get_sql_for_query( $this->queries );

		if ( ! empty( $sql['where'] ) ) {
			$sql['where'] = ' AND ' . "\n" . $sql['where'] . "\n";
		}

		return $sql;
	}


Top ↑

Changelog Changelog

Changelog
Version Description
2.2.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.