class ExtendedSearchApiQuery in Views Contextual Filters OR 8
Object used to create a SELECT query.
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements DerivativeInspectionInterface, PluginInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
- class \Drupal\views\Plugin\views\PluginBase implements DependentPluginInterface, ContainerFactoryPluginInterface, TrustedCallbackInterface, ViewsPluginInterface
- class \Drupal\views\Plugin\views\query\QueryPluginBase implements CacheableDependencyInterface
- class \Drupal\search_api\Plugin\views\query\SearchApiQuery uses LoggerTrait
- class \Drupal\views_contextual_filters_or\Plugin\views\query\ExtendedSearchApiQuery
- class \Drupal\search_api\Plugin\views\query\SearchApiQuery uses LoggerTrait
- class \Drupal\views\Plugin\views\query\QueryPluginBase implements CacheableDependencyInterface
- class \Drupal\views\Plugin\views\PluginBase implements DependentPluginInterface, ContainerFactoryPluginInterface, TrustedCallbackInterface, ViewsPluginInterface
- class \Drupal\Core\Plugin\PluginBase uses DependencySerializationTrait, MessengerTrait, StringTranslationTrait
Expanded class hierarchy of ExtendedSearchApiQuery
File
- src/
Plugin/ views/ query/ ExtendedSearchApiQuery.php, line 13
Namespace
Drupal\views_contextual_filters_or\Plugin\views\queryView source
class ExtendedSearchApiQuery extends SearchApiQuery {
/**
* {@inheritdoc}
*/
public function defineOptions() {
$options = parent::defineOptions();
$options['contextual_filters_or'] = array(
'default' => FALSE,
);
return $options;
}
/**
* {@inheritdoc}
*/
public function buildOptionsForm(&$form, FormStateInterface $form_state) {
parent::buildOptionsForm($form, $form_state);
$form['contextual_filters_or'] = array(
'#title' => t('Contextual filters OR'),
'#description' => t('Contextual filters applied to OR logic.'),
'#type' => 'checkbox',
'#default_value' => !empty($this->options['contextual_filters_or']),
);
}
/**
* {@inheritdoc}
*/
public function build(ViewExecutable $view) {
if (!empty($this->where) && $this->options['contextual_filters_or']) {
$where = [];
foreach ($this->where as $group_id => $group) {
if (empty($group_id) && (!empty($group['conditions']) || !empty($group['condition_groups']))) {
$group += [
'type' => 'OR',
];
if ($group_id === '') {
$group_id = 0;
}
}
$where[$group_id] = $group;
}
$this->where = $where;
}
parent::build($view);
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DependencySerializationTrait:: |
protected | property | An array of entity type IDs keyed by the property name of their storages. | |
DependencySerializationTrait:: |
protected | property | An array of service IDs keyed by property name used for serialization. | |
DependencySerializationTrait:: |
public | function | 1 | |
DependencySerializationTrait:: |
public | function | 2 | |
ExtendedSearchApiQuery:: |
public | function |
Builds the necessary info to execute the query. Overrides SearchApiQuery:: |
|
ExtendedSearchApiQuery:: |
public | function |
Provide a form to edit options for this plugin. Overrides SearchApiQuery:: |
|
ExtendedSearchApiQuery:: |
public | function |
Information about options for all kinds of purposes will be held here.
@code
'option_name' => array( Overrides SearchApiQuery:: |
|
LoggerTrait:: |
protected | property | The logging channel to use. | |
LoggerTrait:: |
public | function | Retrieves the logger. | |
LoggerTrait:: |
protected | function | Logs an exception. | |
LoggerTrait:: |
public | function | Sets the logger. | |
MessengerTrait:: |
public | function | Gets the messenger. | 29 |
PluginBase:: |
protected | property | Configuration information passed into the plugin. | 1 |
PluginBase:: |
public | property | Plugins's definition | |
PluginBase:: |
public | property | The display object this plugin is for. | |
PluginBase:: |
public | property | Options for this plugin will be held here. | |
PluginBase:: |
protected | property | The plugin implementation definition. | 1 |
PluginBase:: |
protected | property | The plugin_id. | |
PluginBase:: |
protected | property | Stores the render API renderer. | 3 |
PluginBase:: |
protected | property | Denotes whether the plugin has an additional options form. | 8 |
PluginBase:: |
public | property | The top object of a view. | 1 |
PluginBase:: |
constant | A string which is used to separate base plugin IDs from the derivative ID. | ||
PluginBase:: |
public | function |
Clears a plugin. Overrides ViewsPluginInterface:: |
2 |
PluginBase:: |
protected | function | Do the work to filter out stored options depending on the defined options. | |
PluginBase:: |
public | function |
Filter out stored options depending on the defined options. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public | function |
Returns an array of available token replacements. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public | function |
Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface:: |
|
PluginBase:: |
public | function |
Gets the definition of the plugin implementation. Overrides PluginInspectionInterface:: |
3 |
PluginBase:: |
public | function |
Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface:: |
|
PluginBase:: |
public | function |
Returns the plugin provider. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
protected | function | Returns the render API renderer. | 1 |
PluginBase:: |
public | function |
Adds elements for available core tokens to a form. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public | function |
Returns a string with any core tokens replaced. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
constant | Include entity row languages when listing languages. | ||
PluginBase:: |
constant | Include negotiated languages when listing languages. | ||
PluginBase:: |
public | function | Determines if the plugin is configurable. | |
PluginBase:: |
protected | function | Makes an array of languages, optionally including special languages. | |
PluginBase:: |
public | function |
Return the human readable name of the display. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public static | function |
Moves form elements into fieldsets for presentation purposes. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public static | function |
Flattens the structure of form elements. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public static | function | Returns substitutions for Views queries for languages. | |
PluginBase:: |
protected | function | Fills up the options of the plugin with defaults. | |
PluginBase:: |
public | function |
Provide a full list of possible theme templates used by this style. Overrides ViewsPluginInterface:: |
1 |
PluginBase:: |
public static | function |
Lists the trusted callbacks provided by the implementing class. Overrides TrustedCallbackInterface:: |
6 |
PluginBase:: |
public | function |
Unpack options over our existing defaults, drilling down into arrays
so that defaults don't get totally blown away. Overrides ViewsPluginInterface:: |
|
PluginBase:: |
public | function |
Returns the usesOptions property. Overrides ViewsPluginInterface:: |
8 |
PluginBase:: |
public | function |
Validate that the plugin is correct and can be saved. Overrides ViewsPluginInterface:: |
6 |
PluginBase:: |
protected | function | Replaces Views' tokens in a given string. The resulting string will be sanitized with Xss::filterAdmin. | 1 |
PluginBase:: |
constant | Query string to indicate the site default language. | ||
PluginBase:: |
public | function |
Constructs a PluginBase object. Overrides PluginBase:: |
|
QueryPluginBase:: |
public | property | A pager plugin that should be provided by the display. | |
QueryPluginBase:: |
public | function | Add a signature to the query, if such a thing is feasible. | 1 |
QueryPluginBase:: |
public | function | Get aggregation info for group by queries. | 1 |
QueryPluginBase:: |
public | function | Returns a Unix timestamp to database native timestamp expression. | 1 |
QueryPluginBase:: |
public | function | Creates cross-database date formatting. | 1 |
QueryPluginBase:: |
public | function | Returns an array of all tables from the query that map to an entity type. | |
QueryPluginBase:: |
public | function | Returns the limit of the query. | |
QueryPluginBase:: |
public | function | Get the timezone offset in seconds. | |
QueryPluginBase:: |
public | function | Loads all entities contained in the passed-in $results. . If the entity belongs to the base table, then it gets stored in $result->_entity. Otherwise, it gets stored in $result->_relationship_entities[$relationship_id]; | 1 |
QueryPluginBase:: |
public | function | Applies a timezone offset to the given field. | 2 |
QueryPluginBase:: |
public | function | Control how all WHERE and HAVING groups are put together. | |
QueryPluginBase:: |
public | function | Set a LIMIT on the query, specifying a maximum number of results. | |
QueryPluginBase:: |
public | function | Set an OFFSET on the query, specifying a number of results to skip | |
QueryPluginBase:: |
public | function | Set the database to the current user timezone. | 1 |
QueryPluginBase:: |
public | function | Create a new grouping for the WHERE or HAVING clause. | |
QueryPluginBase:: |
public | function |
Handle any special handling on the validate form. Overrides PluginBase:: |
1 |
QueryPluginBase:: |
public | function |
Returns the summary of the settings in the display. Overrides PluginBase:: |
|
QueryPluginBase:: |
public | function |
Validate the options form. Overrides PluginBase:: |
|
SearchApiQuery:: |
protected | property | Whether to abort the search instead of executing it. | |
SearchApiQuery:: |
protected | property | Array of all encountered errors. | |
SearchApiQuery:: |
protected | property | The conjunction with which multiple filter groups are combined. | |
SearchApiQuery:: |
protected | property | The index this view accesses. | |
SearchApiQuery:: |
protected | property |
Number of results to display. Overrides QueryPluginBase:: |
|
SearchApiQuery:: |
protected | property |
The messenger. Overrides MessengerTrait:: |
|
SearchApiQuery:: |
protected | property | The module handler. | |
SearchApiQuery:: |
protected | property | Offset of first displayed result. | |
SearchApiQuery:: |
protected | property | The query that will be executed. | |
SearchApiQuery:: |
protected | property | The IDs of fields whose values should be retrieved by the backend. | |
SearchApiQuery:: |
protected | property | The query's conditions representing the different Views filter groups. | |
SearchApiQuery:: |
public | function | Aborts this search query. | |
SearchApiQuery:: |
public | function | Adds a new ($field $operator $value) condition filter. | |
SearchApiQuery:: |
public | function | Adds a nested condition group. | |
SearchApiQuery:: |
public | function | Adds a field to the table. | |
SearchApiQuery:: |
public | function | Adds an ORDER BY clause to the query. | |
SearchApiQuery:: |
protected | function | Adds Search API result items to a view's result set. | |
SearchApiQuery:: |
public | function | Adds a field value to be retrieved. | |
SearchApiQuery:: |
public | function | Adds a property to be retrieved. | |
SearchApiQuery:: |
public | function | Adds a simple condition to the query. | |
SearchApiQuery:: |
public | function |
Let modules modify the query just prior to finalizing it. Overrides QueryPluginBase:: |
|
SearchApiQuery:: |
public | function |
Calculates dependencies for the configured plugin. Overrides QueryPluginBase:: |
|
SearchApiQuery:: |
public static | function |
Creates an instance of the plugin. Overrides PluginBase:: |
|
SearchApiQuery:: |
public | function | Creates a new condition group to use with this query object. | |
SearchApiQuery:: |
public | function | Ensures a table exists in the query. | |
SearchApiQuery:: |
public | function |
Executes the query and fills the associated view object with according
values. Overrides QueryPluginBase:: |
|
SearchApiQuery:: |
public | function | Retrieves the account object to use for access checks for this query. | |
SearchApiQuery:: |
public | function |
The cache contexts associated with this object. Overrides QueryPluginBase:: |
|
SearchApiQuery:: |
public | function |
The maximum age for which this object may be cached. Overrides QueryPluginBase:: |
|
SearchApiQuery:: |
public | function |
The cache tags associated with this object. Overrides QueryPluginBase:: |
|
SearchApiQuery:: |
public static | function | Retrieves the contained entity from a Views result row. | |
SearchApiQuery:: |
public | function | Checks for entity types contained in the current view's index. | |
SearchApiQuery:: |
public | function | Retrieves the filter object associated with this search query. | |
SearchApiQuery:: |
public | function | Retrieves the fulltext fields that will be searched for the search keys. | |
SearchApiQuery:: |
public | function | Retrieves the conjunction with which multiple filter groups are combined. | |
SearchApiQuery:: |
public | function | Returns the group type of the given group. | |
SearchApiQuery:: |
public | function | Retrieves the index associated with this search. | |
SearchApiQuery:: |
public static | function | Loads the search index belonging to the given Views base table. | |
SearchApiQuery:: |
public | function | Retrieves the search keys for this query. | |
SearchApiQuery:: |
public | function | Retrieves the languages that will be searched by this query. | |
SearchApiQuery:: |
public | function | Retrieves the messenger. | |
SearchApiQuery:: |
public | function | Retrieves the module handler. | |
SearchApiQuery:: |
public | function | Retrieves an option set on this search query. | |
SearchApiQuery:: |
public | function | Retrieves all options set for this search query. | |
SearchApiQuery:: |
public | function | Retrieves the unparsed search keys for this query as originally entered. | |
SearchApiQuery:: |
public | function | Retrieves the parse mode. | |
SearchApiQuery:: |
public | function | Returns the Search API query object used by this Views query. | |
SearchApiQuery:: |
public | function | Retrieves the Search API result set returned for this query. | |
SearchApiQuery:: |
public | function | Retrieves the sorts set for this query. | |
SearchApiQuery:: |
public | function | Retrieves the conditions placed on this query. | |
SearchApiQuery:: |
public | function |
Constructor; Create the basic query object and fill with default values. Overrides PluginBase:: |
|
SearchApiQuery:: |
public | function | Sets the keys to search for. | |
SearchApiQuery:: |
public | function |
Generate a query and a countquery from all of the information supplied
to the object. Overrides QueryPluginBase:: |
|
SearchApiQuery:: |
public | function | Adds a range of results to return. | |
SearchApiQuery:: |
protected | function | Adapts a field ID for use in a Search API query. | |
SearchApiQuery:: |
protected | function | Adapts an operator for use in a Search API query. | |
SearchApiQuery:: |
public | function | Sets the fields that will be searched for the search keys. | |
SearchApiQuery:: |
public | function | Sets the languages that should be searched by this query. | |
SearchApiQuery:: |
public | function |
Sets the messenger. Overrides MessengerTrait:: |
|
SearchApiQuery:: |
public | function | Sets the module handler. | |
SearchApiQuery:: |
public | function | Sets an option for this search query. | |
SearchApiQuery:: |
public | function | Sets the parse mode. | |
SearchApiQuery:: |
public | function | Sets the Search API query object. | |
SearchApiQuery:: |
public | function | Checks whether this query should be aborted. | |
SearchApiQuery:: |
public | function | Adds a sort directive to this search query. | |
SearchApiQuery:: |
protected | function | Transforms a database condition to an equivalent search filter. | |
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
TrustedCallbackInterface:: |
constant | Untrusted callbacks throw exceptions. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger silenced E_USER_DEPRECATION errors. | ||
TrustedCallbackInterface:: |
constant | Untrusted callbacks trigger E_USER_WARNING errors. |