Extends the core SearchQuery to be able to gets it's protected values.
Expanded class hierarchy of ViewsSearchQuery
class ViewsSearchQuery extends SearchQuery {
/**
* Returns the conditions property.
*
* @return array
*/
public function &conditions() {
return $this->conditions;
}
/**
* Returns the words property.
*
* @return array
*/
public function words() {
return $this->words;
}
/**
* Returns the simple property.
*
* @return bool
*/
public function simple() {
return $this->simple;
}
/**
* Returns the matches property.
*
* @return int
*/
public function matches() {
return $this->matches;
}
/**
* Executes and returns the protected parseSearchExpression method.
*/
public function publicParseSearchExpression() {
return $this
->parseSearchExpression();
}
/**
* Replaces the original condition with a custom one from views recursively.
*
* @param string $search
* The searched value.
* @param string $replace
* The value which replaces the search value.
* @param Drupal\Core\Database\Query\Condition $condition
* The query condition in which the string is replaced.
*/
function condition_replace_string($search, $replace, &$condition) {
if ($condition['field'] instanceof Condition) {
$conditions =& $condition['field']
->conditions();
foreach ($conditions as $key => &$subcondition) {
if (is_numeric($key)) {
// As conditions can have subconditions, for example db_or(), the
// function has to be called recursively.
$this
->condition_replace_string($search, $replace, $subcondition);
}
}
}
else {
$condition['field'] = str_replace($search, $replace, $condition['field']);
}
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
SearchQuery:: |
protected | property | Conditions that are used for exact searches. | |
SearchQuery:: |
protected | property | Indicates whether the first pass query has been executed. | |
SearchQuery:: |
protected | property | Whether or not search expressions were ignored. | |
SearchQuery:: |
protected | property | Positive and negative search keys. | |
SearchQuery:: |
protected | property | Indicates how many matches for a search query are necessary. | |
SearchQuery:: |
protected | property | Total value of all the multipliers. | |
SearchQuery:: |
protected | property | Multiplier for the normalized search score. | |
SearchQuery:: |
protected | property | Stores score expressions. | |
SearchQuery:: |
protected | property | Stores arguments for score expressions. | |
SearchQuery:: |
protected | property | The search query that is used for searching. | |
SearchQuery:: |
protected | property | Indicates whether the first pass query requires complex conditions (LIKE). | |
SearchQuery:: |
protected | property | The type of search (search module). | |
SearchQuery:: |
protected | property | Array of search words. | |
SearchQuery:: |
public | function | Adds a custom score expression to the search query. | |
SearchQuery:: |
public | function |
Builds the default count query for SearchQuery. Overrides SelectExtender:: |
|
SearchQuery:: |
public | function |
Executes the search. Overrides SelectExtender:: |
|
SearchQuery:: |
public | function | Executes the first pass query. | |
SearchQuery:: |
protected | function | Parses the search query into SQL conditions. | |
SearchQuery:: |
protected | function | Helper function for parseQuery(). | |
SearchQuery:: |
public | function | Sets up the search query expression. | |
SearchQuery:: |
public | function | Applies a search option and removes it from the search query string. | |
SelectExtender:: |
protected | property | The connection object on which to run this query. | |
SelectExtender:: |
protected | property | The placeholder counter. | |
SelectExtender:: |
protected | property | The Select query object we are extending/decorating. | |
SelectExtender:: |
protected | property | A unique identifier for this query object. | |
SelectExtender:: |
public | function |
Adds an expression to the list of "fields" to be SELECTed. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Adds a field to the list to be SELECTed. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Join against another table in the database. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Adds additional metadata to the query. Overrides AlterableInterface:: |
|
SelectExtender:: |
public | function |
Adds a tag to a query. Overrides AlterableInterface:: |
|
SelectExtender:: |
public | function |
Gets a complete list of all values to insert into the prepared statement. Overrides ConditionInterface:: |
|
SelectExtender:: |
public | function |
Compiles the saved conditions for later retrieval. Overrides ConditionInterface:: |
|
SelectExtender:: |
public | function |
Check whether a condition has been previously compiled. Overrides ConditionInterface:: |
|
SelectExtender:: |
public | function |
Helper function: builds the most common conditional clauses. Overrides ConditionInterface:: |
|
SelectExtender:: |
public | function |
Sets this query to be DISTINCT. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Sets a condition that the specified subquery returns values. Overrides ConditionInterface:: |
|
SelectExtender:: |
public | function |
Enhance this object by wrapping it in an extender object. Overrides ExtendableInterface:: |
|
SelectExtender:: |
public | function |
Add multiple fields from the same table to be SELECTed. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Add FOR UPDATE to the query. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Compiles and returns an associative array of the arguments for this prepared statement. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Returns a reference to the expressions array for this query. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Returns a reference to the fields array for this query. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Returns a reference to the group-by array for this query. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Retrieves a given piece of metadata. Overrides AlterableInterface:: |
|
SelectExtender:: |
public | function |
Returns a reference to the order by array for this query. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Returns a reference to the tables array for this query. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Returns a reference to the union queries for this query. This include
queries for UNION, UNION ALL, and UNION DISTINCT. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Groups the result set by the specified field. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Determines if a given query has all specified tags. Overrides AlterableInterface:: |
|
SelectExtender:: |
public | function |
Determines if a given query has any specified tag. Overrides AlterableInterface:: |
|
SelectExtender:: |
public | function |
Determines if a given query has a given tag. Overrides AlterableInterface:: |
|
SelectExtender:: |
public | function | ||
SelectExtender:: |
public | function | ||
SelectExtender:: |
public | function | ||
SelectExtender:: |
public | function |
Helper function to build most common HAVING conditional clauses. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function | ||
SelectExtender:: |
public | function |
Inner Join against another table in the database. Overrides SelectInterface:: |
|
SelectExtender:: |
function |
Sets a condition that the specified field be NOT NULL. Overrides ConditionInterface:: |
||
SelectExtender:: |
function |
Sets a condition that the specified field be NULL. Overrides ConditionInterface:: |
||
SelectExtender:: |
public | function |
Indicates if preExecute() has already been called on that object. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Default Join against another table in the database. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Left Outer Join against another table in the database. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Implements Drupal\Core\Database\Query\PlaceholderInterface::nextPlaceholder(). Overrides PlaceholderInterface:: |
|
SelectExtender:: |
public | function |
Sets a condition that the specified subquery returns no values. Overrides ConditionInterface:: |
|
SelectExtender:: |
public | function |
Orders the result set by a given field. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Orders the result set by a random value. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Generic preparation and validation for a SELECT query. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Restricts a query to a given range in the result set. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Right Outer Join against another table in the database. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Add another Select query to UNION to this one. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function |
Implements Drupal\Core\Database\Query\PlaceholderInterface::uniqueIdentifier(). Overrides PlaceholderInterface:: |
|
SelectExtender:: |
public | function |
Adds an arbitrary WHERE clause to the query. Overrides ConditionInterface:: |
|
SelectExtender:: |
public | function | Magic override for undefined methods. | |
SelectExtender:: |
public | function |
Clone magic method. Overrides SelectInterface:: |
|
SelectExtender:: |
public | function | 2 | |
SelectExtender:: |
public | function | ||
ViewsSearchQuery:: |
public | function |
Returns the conditions property. Overrides SelectExtender:: |
|
ViewsSearchQuery:: |
function | Replaces the original condition with a custom one from views recursively. | ||
ViewsSearchQuery:: |
public | function | Returns the matches property. | |
ViewsSearchQuery:: |
public | function | Executes and returns the protected parseSearchExpression method. | |
ViewsSearchQuery:: |
public | function | Returns the simple property. | |
ViewsSearchQuery:: |
public | function | Returns the words property. |