You are here

class SearchApiFulltext in Search API 8

Same name in this branch
  1. 8 src/Plugin/views/filter/SearchApiFulltext.php \Drupal\search_api\Plugin\views\filter\SearchApiFulltext
  2. 8 src/Plugin/views/argument/SearchApiFulltext.php \Drupal\search_api\Plugin\views\argument\SearchApiFulltext

Defines a filter for adding a fulltext search to the view.

Plugin annotation

@ViewsFilter("search_api_fulltext");

Hierarchy

Expanded class hierarchy of SearchApiFulltext

File

src/Plugin/views/filter/SearchApiFulltext.php, line 18

Namespace

Drupal\search_api\Plugin\views\filter
View source
class SearchApiFulltext extends FilterPluginBase {
  use SearchApiFilterTrait;

  /**
   * The list of fields selected for the search.
   *
   * @var array
   */
  public $searchedFields = [];

  /**
   * The parse mode manager.
   *
   * @var \Drupal\search_api\ParseMode\ParseModePluginManager|null
   */
  protected $parseModeManager;

  /**
   * {@inheritdoc}
   */
  public static function create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition) {

    /** @var static $plugin */
    $plugin = parent::create($container, $configuration, $plugin_id, $plugin_definition);
    $plugin
      ->setParseModeManager($container
      ->get('plugin.manager.search_api.parse_mode'));
    return $plugin;
  }

  /**
   * Retrieves the parse mode manager.
   *
   * @return \Drupal\search_api\ParseMode\ParseModePluginManager
   *   The parse mode manager.
   */
  public function getParseModeManager() {
    return $this->parseModeManager ?: \Drupal::service('plugin.manager.search_api.parse_mode');
  }

  /**
   * Sets the parse mode manager.
   *
   * @param \Drupal\search_api\ParseMode\ParseModePluginManager $parse_mode_manager
   *   The new parse mode manager.
   *
   * @return $this
   */
  public function setParseModeManager(ParseModePluginManager $parse_mode_manager) {
    $this->parseModeManager = $parse_mode_manager;
    return $this;
  }

  /**
   * {@inheritdoc}
   */
  public function showOperatorForm(&$form, FormStateInterface $form_state) {
    parent::showOperatorForm($form, $form_state);
    if (!empty($form['operator'])) {
      $form['operator']['#description'] = $this
        ->t('Depending on the parse mode set, some of these options might not work as expected. Please either use "@multiple_words" as the parse mode or make sure that the filter behaves as expected for multiple words.', [
        '@multiple_words' => $this
          ->t('Multiple words'),
      ]);
    }
  }

  /**
   * {@inheritdoc}
   */
  public function operatorOptions($which = 'title') {
    $options = [];
    foreach ($this
      ->operators() as $id => $info) {
      $options[$id] = $info[$which];
    }
    return $options;
  }

  /**
   * Returns information about the available operators for this filter.
   *
   * @return array[]
   *   An associative array mapping operator identifiers to their information.
   *   The operator information itself is an associative array with the
   *   following keys:
   *   - title: The translated title for the operator.
   *   - short: The translated short title for the operator.
   *   - values: The number of values the operator requires as input.
   */
  public function operators() {
    return [
      'and' => [
        'title' => $this
          ->t('Contains all of these words'),
        'short' => $this
          ->t('and'),
        'values' => 1,
      ],
      'or' => [
        'title' => $this
          ->t('Contains any of these words'),
        'short' => $this
          ->t('or'),
        'values' => 1,
      ],
      'not' => [
        'title' => $this
          ->t('Contains none of these words'),
        'short' => $this
          ->t('not'),
        'values' => 1,
      ],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function defineOptions() {
    $options = parent::defineOptions();
    $options['operator']['default'] = 'and';
    $options['parse_mode'] = [
      'default' => 'terms',
    ];
    $options['min_length'] = [
      'default' => '',
    ];
    $options['fields'] = [
      'default' => [],
    ];
    $options['expose']['contains']['placeholder'] = [
      'default' => '',
    ];
    $options['expose']['contains']['expose_fields'] = [
      'default' => FALSE,
    ];
    $options['expose']['contains']['searched_fields_id'] = [
      'default' => '',
    ];
    return $options;
  }

  /**
   * {@inheritdoc}
   */
  public function defaultExposeOptions() {
    parent::defaultExposeOptions();
    $this->options['expose']['searched_fields_id'] = $this->options['id'] . '_searched_fields';
  }

  /**
   * {@inheritdoc}
   */
  public function buildOptionsForm(&$form, FormStateInterface $form_state) {
    parent::buildOptionsForm($form, $form_state);
    $form['parse_mode'] = [
      '#type' => 'select',
      '#title' => $this
        ->t('Parse mode'),
      '#description' => $this
        ->t('Choose how the search keys will be parsed.'),
      '#options' => [],
      '#default_value' => $this->options['parse_mode'],
    ];
    foreach ($this
      ->getParseModeManager()
      ->getInstances() as $key => $mode) {
      if ($mode
        ->isHidden()) {
        continue;
      }
      $form['parse_mode']['#options'][$key] = $mode
        ->label();
      if ($mode
        ->getDescription()) {
        $states['visible'][':input[name="options[parse_mode]"]']['value'] = $key;
        $form["parse_mode_{$key}_description"] = [
          '#type' => 'item',
          '#title' => $mode
            ->label(),
          '#description' => $mode
            ->getDescription(),
          '#states' => $states,
        ];
      }
    }
    $fields = $this
      ->getFulltextFields();
    if (!empty($fields)) {
      $form['fields'] = [
        '#type' => 'select',
        '#title' => $this
          ->t('Searched fields'),
        '#description' => $this
          ->t('Select the fields that will be searched. If no fields are selected, all available fulltext fields will be searched.'),
        '#options' => $fields,
        '#size' => min(4, count($fields)),
        '#multiple' => TRUE,
        '#default_value' => $this->options['fields'],
      ];
    }
    else {
      $form['fields'] = [
        '#type' => 'value',
        '#value' => [],
      ];
    }
    if (isset($form['expose'])) {
      $form['expose']['#weight'] = -5;
    }
    $form['min_length'] = [
      '#title' => $this
        ->t('Minimum keyword length'),
      '#description' => $this
        ->t('Minimum length of each word in the search keys. Leave empty to allow all words.'),
      '#type' => 'number',
      '#min' => 1,
      '#default_value' => $this->options['min_length'],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function buildExposeForm(&$form, FormStateInterface $form_state) {
    parent::buildExposeForm($form, $form_state);
    $form['expose']['placeholder'] = [
      '#type' => 'textfield',
      '#default_value' => $this->options['expose']['placeholder'],
      '#title' => $this
        ->t('Placeholder'),
      '#size' => 40,
      '#description' => $this
        ->t('Hint text that appears inside the field when empty.'),
    ];
    $form['expose']['expose_fields'] = [
      '#type' => 'checkbox',
      '#default_value' => $this->options['expose']['expose_fields'],
      '#title' => $this
        ->t('Expose searched fields'),
      '#description' => $this
        ->t('Expose the list of searched fields. This allows users to narrow the search to the desired fields.'),
    ];
    $form['expose']['searched_fields_id'] = [
      '#type' => 'textfield',
      '#default_value' => $this->options['expose']['searched_fields_id'],
      '#title' => $this
        ->t('Searched fields identifier'),
      '#size' => 40,
      '#description' => $this
        ->t('This will appear in the URL after the ? to identify this searched fields form element.'),
      '#states' => [
        'visible' => [
          ':input[name="options[expose][expose_fields]"]' => [
            'checked' => TRUE,
          ],
        ],
      ],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function buildExposedForm(&$form, FormStateInterface $form_state) {
    parent::buildExposedForm($form, $form_state);
    if (empty($this->options['exposed'])) {
      return;
    }
    if ($this->options['expose']['expose_fields']) {
      $fields = $this
        ->getFulltextFields();
      $configured_fields = $this->options['fields'];

      // Only keep the configured fields.
      if (!empty($configured_fields)) {
        $configured_fields = array_flip($configured_fields);
        $fields = array_intersect_key($fields, $configured_fields);
      }
      $searched_fields_identifier = $this->options['id'] . '_searched_fields';
      if (!empty($this->options['expose']['searched_fields_id'])) {
        $searched_fields_identifier = $this->options['expose']['searched_fields_id'];
      }
      $form[$searched_fields_identifier] = [
        '#type' => 'select',
        '#title' => $this
          ->t('Search fields'),
        '#options' => $fields,
        '#multiple' => TRUE,
        '#size' => min(count($fields), 5),
      ];
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function valueForm(&$form, FormStateInterface $form_state) {
    parent::valueForm($form, $form_state);
    $form['value'] = [
      '#type' => 'textfield',
      '#title' => !$form_state
        ->get('exposed') ? $this
        ->t('Value') : '',
      '#size' => 30,
      '#default_value' => $this->value,
    ];
    if (!empty($this->options['expose']['placeholder'])) {
      $form['value']['#attributes']['placeholder'] = $this->options['expose']['placeholder'];
    }
  }

  /**
   * {@inheritdoc}
   */
  protected function exposedTranslate(&$form, $type) {
    parent::exposedTranslate($form, $type);

    // We use custom validation for "required", so don't want the Form API to
    // interfere.
    // @see ::validateExposed()
    $form['#required'] = FALSE;
  }

  /**
   * {@inheritdoc}
   */
  public function validateExposed(&$form, FormStateInterface $form_state) {

    // Only validate exposed input.
    if (empty($this->options['exposed']) || empty($this->options['expose']['identifier'])) {
      return;
    }

    // Store searched fields.
    $searched_fields_identifier = $this->options['id'] . '_searched_fields';
    if (!empty($this->options['expose']['searched_fields_id'])) {
      $searched_fields_identifier = $this->options['expose']['searched_fields_id'];
    }
    $this->searchedFields = $form_state
      ->getValue($searched_fields_identifier, []);
    $identifier = $this->options['expose']['identifier'];
    $input =& $form_state
      ->getValue($identifier, '');
    if ($this->options['is_grouped'] && isset($this->options['group_info']['group_items'][$input])) {
      $this->operator = $this->options['group_info']['group_items'][$input]['operator'];
      $input =& $this->options['group_info']['group_items'][$input]['value'];
    }

    // Under some circumstances, input will be an array containing the string
    // value. Not sure why, but just deal with that.
    while (is_array($input)) {
      $input = $input ? reset($input) : '';
    }
    if (trim($input) === '') {

      // No input was given by the user. If the filter was set to "required" and
      // there is a query (not the case when an exposed filter block is
      // displayed stand-alone), abort it.
      if (!empty($this->options['expose']['required']) && $this
        ->getQuery()) {
        $this
          ->getQuery()
          ->abort();
      }

      // If the input is empty, there is nothing to validate: return early.
      return;
    }

    // Only continue if there is a minimum word length set.
    if ($this->options['min_length'] < 2) {
      return;
    }
    $words = preg_split('/\\s+/', $input);
    foreach ($words as $i => $word) {
      if (mb_strlen($word) < $this->options['min_length']) {
        unset($words[$i]);
      }
    }
    if (!$words) {
      $vars['@count'] = $this->options['min_length'];
      $msg = $this
        ->t('You must include at least one positive keyword with @count characters or more.', $vars);
      $form_state
        ->setErrorByName($identifier, $msg);
    }
    $input = implode(' ', $words);
  }

  /**
   * {@inheritdoc}
   */
  public function query() {
    while (is_array($this->value)) {
      $this->value = $this->value ? reset($this->value) : '';
    }

    // Catch empty strings entered by the user, but not "0".
    if ($this->value === '') {
      return;
    }
    $fields = $this->options['fields'];
    $fields = $fields ?: array_keys($this
      ->getFulltextFields());

    // Override the search fields, if exposed.
    if (!empty($this->searchedFields)) {
      $fields = array_intersect($fields, $this->searchedFields);
    }
    $query = $this
      ->getQuery();

    // Save any keywords that were already set.
    $old = $query
      ->getKeys();
    $old_original = $query
      ->getOriginalKeys();
    if ($this->options['parse_mode']) {

      /** @var \Drupal\search_api\ParseMode\ParseModeInterface $parse_mode */
      $parse_mode = $this
        ->getParseModeManager()
        ->createInstance($this->options['parse_mode']);
      $query
        ->setParseMode($parse_mode);
    }

    // If something already specifically set different fields, we silently fall
    // back to mere filtering.
    $old_fields = $query
      ->getFulltextFields();
    $use_conditions = $old_fields && (array_diff($old_fields, $fields) || array_diff($fields, $old_fields));
    if ($use_conditions) {
      $conditions = $query
        ->createConditionGroup('OR');
      $op = $this->operator === 'not' ? '<>' : '=';
      foreach ($fields as $field) {
        $conditions
          ->addCondition($field, $this->value, $op);
      }
      $query
        ->addConditionGroup($conditions);
      return;
    }

    // If the operator was set to OR or NOT, set OR as the conjunction. It is
    // also set for NOT since otherwise it would be "not all of these words".
    if ($this->operator != 'and') {
      $query
        ->getParseMode()
        ->setConjunction('OR');
    }
    $query
      ->setFulltextFields($fields);
    $query
      ->keys($this->value);
    if ($this->operator == 'not') {
      $keys =& $query
        ->getKeys();
      if (is_array($keys)) {
        $keys['#negation'] = TRUE;
      }
      else {

        // We can't know how negation is expressed in the server's syntax.
      }
      unset($keys);
    }

    // If there were fulltext keys set, we take care to combine them in a
    // meaningful way (especially with negated keys).
    if ($old) {
      $keys =& $query
        ->getKeys();

      // Array-valued keys are combined.
      if (is_array($keys)) {

        // If the old keys weren't parsed into an array, we instead have to
        // combine the original keys.
        if (is_scalar($old)) {
          $keys = "({$old}) ({$this->value})";
        }
        else {

          // If the conjunction or negation settings aren't the same, we have to
          // nest both old and new keys array.
          if (empty($keys['#negation']) !== empty($old['#negation']) || $keys['#conjunction'] !== $old['#conjunction']) {
            $keys = [
              '#conjunction' => 'AND',
              $old,
              $keys,
            ];
          }
          else {
            foreach ($old as $key => $value) {
              if (substr($key, 0, 1) === '#') {
                continue;
              }
              $keys[] = $value;
            }
          }
        }
      }
      elseif (is_scalar($old_original)) {
        $combined_keys = "({$old_original}) ({$keys})";
        $query
          ->keys($combined_keys);
        $keys = $combined_keys;
      }
      unset($keys);
    }
  }

  /**
   * Retrieves a list of all available fulltext fields.
   *
   * @return string[]
   *   An options list of fulltext field identifiers mapped to their prefixed
   *   labels.
   */
  protected function getFulltextFields() {
    $fields = [];

    /** @var \Drupal\search_api\IndexInterface $index */
    $index = Index::load(substr($this->table, 17));
    $fields_info = $index
      ->getFields();
    foreach ($index
      ->getFulltextFields() as $field_id) {
      $fields[$field_id] = $fields_info[$field_id]
        ->getPrefixedLabel();
    }
    return $fields;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
DependencySerializationTrait::$_entityStorages protected property An array of entity type IDs keyed by the property name of their storages.
DependencySerializationTrait::$_serviceIds protected property An array of service IDs keyed by property name used for serialization.
DependencySerializationTrait::__sleep public function 1
DependencySerializationTrait::__wakeup public function 2
FilterPluginBase::$alwaysMultiple protected property Disable the possibility to force a single value. 6
FilterPluginBase::$always_required public property Disable the possibility to allow a exposed input to be optional.
FilterPluginBase::$group_info public property Contains the information of the selected item in a grouped filter.
FilterPluginBase::$no_operator public property Disable the possibility to use operators. 1
FilterPluginBase::$operator public property Contains the operator which is used on the query.
FilterPluginBase::$value public property Contains the actual value of the field,either configured in the views ui or entered in the exposed filters.
FilterPluginBase::acceptExposedInput public function Determines if the input from a filter should change the generated query. Overrides HandlerBase::acceptExposedInput 2
FilterPluginBase::addGroupForm public function Add a new group to the exposed filter groups.
FilterPluginBase::adminSummary public function Display the filter on the administrative summary Overrides HandlerBase::adminSummary 10
FilterPluginBase::arrayFilterZero protected static function Filter by no empty values, though allow the use of (string) "0".
FilterPluginBase::buildExposedFiltersGroupForm protected function Build the form to let users create the group of exposed filters. This form is displayed when users click on button 'Build group'
FilterPluginBase::buildGroupForm public function Displays the Build Group form.
FilterPluginBase::buildGroupOptions protected function Provide default options for exposed filters.
FilterPluginBase::buildGroupSubmit protected function Save new group items, re-enumerates and remove groups marked to delete.
FilterPluginBase::buildGroupValidate protected function Validate the build group options form.
FilterPluginBase::canBuildGroup protected function Determine if a filter can be converted into a group. Only exposed filters with operators available can be converted into groups.
FilterPluginBase::canExpose public function Determine if a filter can be exposed. Overrides HandlerBase::canExpose 5
FilterPluginBase::canGroup public function Can this filter be used in OR groups? 1
FilterPluginBase::convertExposedInput public function Transform the input from a grouped filter into a standard filter.
FilterPluginBase::exposedInfo public function Tell the renderer about our exposed form. This only needs to be overridden for particularly complex forms. And maybe not even then. Overrides HandlerBase::exposedInfo
FilterPluginBase::getCacheContexts public function The cache contexts associated with this object. Overrides CacheableDependencyInterface::getCacheContexts 7
FilterPluginBase::getCacheMaxAge public function The maximum age for which this object may be cached. Overrides CacheableDependencyInterface::getCacheMaxAge
FilterPluginBase::getCacheTags public function The cache tags associated with this object. Overrides CacheableDependencyInterface::getCacheTags 1
FilterPluginBase::groupForm public function Build a form containing a group of operator | values to apply as a single filter.
FilterPluginBase::groupMultipleExposedInput public function Returns the options available for a grouped filter that users checkboxes as widget, and therefore has to be applied several times, one per item selected.
FilterPluginBase::hasValidGroupedValue protected function Determines if the given grouped filter entry has a valid value. 1
FilterPluginBase::init public function Overrides \Drupal\views\Plugin\views\HandlerBase::init(). Overrides HandlerBase::init 4
FilterPluginBase::isAGroup public function Returns TRUE if the exposed filter works like a grouped filter. Overrides HandlerBase::isAGroup
FilterPluginBase::multipleExposedInput public function Returns TRUE if users can select multiple groups items of a grouped exposed filter. Overrides HandlerBase::multipleExposedInput
FilterPluginBase::operatorForm protected function Options form subform for setting the operator. 6
FilterPluginBase::operatorSubmit public function Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.
FilterPluginBase::operatorValidate protected function Validate the operator form.
FilterPluginBase::prepareFilterSelectOptions protected function Sanitizes the HTML select element's options.
FilterPluginBase::showBuildGroupButton protected function Shortcut to display the build_group/hide button.
FilterPluginBase::showBuildGroupForm public function Shortcut to display the exposed options form.
FilterPluginBase::showExposeButton public function Shortcut to display the expose/hide button. Overrides HandlerBase::showExposeButton
FilterPluginBase::showValueForm protected function Shortcut to display the value form.
FilterPluginBase::storeExposedInput public function If set to remember exposed input in the session, store it there. Overrides HandlerBase::storeExposedInput
FilterPluginBase::storeGroupInput public function If set to remember exposed input in the session, store it there. This function is similar to storeExposedInput but modified to work properly when the filter is a group.
FilterPluginBase::submitOptionsForm public function Simple submit handler Overrides PluginBase::submitOptionsForm
FilterPluginBase::trustedCallbacks public static function Lists the trusted callbacks provided by the implementing class. Overrides PluginBase::trustedCallbacks
FilterPluginBase::validate public function Validate that the plugin is correct and can be saved. Overrides HandlerBase::validate 2
FilterPluginBase::validateExposeForm public function Validate the options form. Overrides HandlerBase::validateExposeForm
FilterPluginBase::validateIdentifier protected function Validates a filter identifier.
FilterPluginBase::validateOptionsForm public function Simple validate handler Overrides PluginBase::validateOptionsForm 1
FilterPluginBase::valueSubmit protected function Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data. 1
FilterPluginBase::valueValidate protected function Validate the options form. 3
HandlerBase::$field public property With field you can override the realField if the real field is not set.
HandlerBase::$moduleHandler protected property The module handler. 3
HandlerBase::$query public property Where the $query object will reside: 7
HandlerBase::$realField public property The actual field in the database table, maybe different on other kind of query plugins/special handlers.
HandlerBase::$relationship public property The relationship used for this field.
HandlerBase::$table public property The table this handler is attached to.
HandlerBase::$tableAlias public property The alias of the table of this handler which is used in the query.
HandlerBase::$viewsData protected property The views data service.
HandlerBase::access public function Check whether given user has access to this handler. Overrides ViewsHandlerInterface::access 4
HandlerBase::adminLabel public function Return a string representing this handler's name in the UI. Overrides ViewsHandlerInterface::adminLabel 4
HandlerBase::breakString public static function Breaks x,y,z and x+y+z into an array. Overrides ViewsHandlerInterface::breakString
HandlerBase::broken public function Determines if the handler is considered 'broken', meaning it's a placeholder used when a handler can't be found. Overrides ViewsHandlerInterface::broken
HandlerBase::buildExtraOptionsForm public function Provide a form for setting options. 1
HandlerBase::buildGroupByForm public function Provide a form for aggregation settings. 1
HandlerBase::calculateDependencies public function Calculates dependencies for the configured plugin. Overrides PluginBase::calculateDependencies 10
HandlerBase::caseTransform protected function Transform a string by a certain method.
HandlerBase::defineExtraOptions public function Provide defaults for the handler.
HandlerBase::displayExposedForm public function Displays the Expose form.
HandlerBase::getDateField public function Creates cross-database SQL dates. 2
HandlerBase::getDateFormat public function Creates cross-database SQL date formatting. 2
HandlerBase::getField public function Shortcut to get a handler's raw field value. Overrides ViewsHandlerInterface::getField
HandlerBase::getJoin public function Get the join object that should be used for this handler. Overrides ViewsHandlerInterface::getJoin
HandlerBase::getModuleHandler protected function Gets the module handler.
HandlerBase::getTableJoin public static function Fetches a handler to join one table to a primary table from the data cache. Overrides ViewsHandlerInterface::getTableJoin
HandlerBase::getViewsData protected function Gets views data service.
HandlerBase::hasExtraOptions public function If a handler has 'extra options' it will get a little settings widget and another form called extra_options. 1
HandlerBase::isExposed public function Determine if this item is 'exposed', meaning it provides form elements to let users modify the view.
HandlerBase::placeholder protected function Provides a unique placeholders for handlers.
HandlerBase::postExecute public function Run after the view is executed, before the result is cached. Overrides ViewsHandlerInterface::postExecute
HandlerBase::preQuery public function Run before the view is built. Overrides ViewsHandlerInterface::preQuery 2
HandlerBase::sanitizeValue public function Sanitize the value for output. Overrides ViewsHandlerInterface::sanitizeValue
HandlerBase::setModuleHandler public function Sets the module handler.
HandlerBase::setRelationship public function Called just prior to query(), this lets a handler set up any relationship it needs. Overrides ViewsHandlerInterface::setRelationship
HandlerBase::setViewsData public function
HandlerBase::showExposeForm public function Shortcut to display the exposed options form. Overrides ViewsHandlerInterface::showExposeForm
HandlerBase::submitExposed public function Submit the exposed handler form
HandlerBase::submitExposeForm public function Perform any necessary changes to the form exposes prior to storage. There is no need for this function to actually store the data.
HandlerBase::submitExtraOptionsForm public function Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data.
HandlerBase::submitFormCalculateOptions public function Calculates options stored on the handler 1
HandlerBase::submitGroupByForm public function Perform any necessary changes to the form values prior to storage. There is no need for this function to actually store the data. 1
HandlerBase::submitTemporaryForm public function A submit handler that is used for storing temporary items when using multi-step changes, such as ajax requests.
HandlerBase::usesGroupBy public function Provides the handler some groupby. 13
HandlerBase::validateExtraOptionsForm public function Validate the options form.
HandlerBase::__construct public function Constructs a Handler object. Overrides PluginBase::__construct 44
MessengerTrait::$messenger protected property The messenger. 29
MessengerTrait::messenger public function Gets the messenger. 29
MessengerTrait::setMessenger public function Sets the messenger.
PluginBase::$configuration protected property Configuration information passed into the plugin. 1
PluginBase::$definition public property Plugins's definition
PluginBase::$displayHandler public property The display object this plugin is for.
PluginBase::$options public property Options for this plugin will be held here.
PluginBase::$pluginDefinition protected property The plugin implementation definition. 1
PluginBase::$pluginId protected property The plugin_id.
PluginBase::$renderer protected property Stores the render API renderer. 3
PluginBase::$usesOptions protected property Denotes whether the plugin has an additional options form. 8
PluginBase::$view public property The top object of a view. 1
PluginBase::DERIVATIVE_SEPARATOR constant A string which is used to separate base plugin IDs from the derivative ID.
PluginBase::destroy public function Clears a plugin. Overrides ViewsPluginInterface::destroy 2
PluginBase::doFilterByDefinedOptions protected function Do the work to filter out stored options depending on the defined options.
PluginBase::filterByDefinedOptions public function Filter out stored options depending on the defined options. Overrides ViewsPluginInterface::filterByDefinedOptions
PluginBase::getAvailableGlobalTokens public function Returns an array of available token replacements. Overrides ViewsPluginInterface::getAvailableGlobalTokens
PluginBase::getBaseId public function Gets the base_plugin_id of the plugin instance. Overrides DerivativeInspectionInterface::getBaseId
PluginBase::getDerivativeId public function Gets the derivative_id of the plugin instance. Overrides DerivativeInspectionInterface::getDerivativeId
PluginBase::getPluginDefinition public function Gets the definition of the plugin implementation. Overrides PluginInspectionInterface::getPluginDefinition 3
PluginBase::getPluginId public function Gets the plugin_id of the plugin instance. Overrides PluginInspectionInterface::getPluginId
PluginBase::getProvider public function Returns the plugin provider. Overrides ViewsPluginInterface::getProvider
PluginBase::getRenderer protected function Returns the render API renderer. 1
PluginBase::globalTokenForm public function Adds elements for available core tokens to a form. Overrides ViewsPluginInterface::globalTokenForm
PluginBase::globalTokenReplace public function Returns a string with any core tokens replaced. Overrides ViewsPluginInterface::globalTokenReplace
PluginBase::INCLUDE_ENTITY constant Include entity row languages when listing languages.
PluginBase::INCLUDE_NEGOTIATED constant Include negotiated languages when listing languages.
PluginBase::isConfigurable public function Determines if the plugin is configurable.
PluginBase::listLanguages protected function Makes an array of languages, optionally including special languages.
PluginBase::pluginTitle public function Return the human readable name of the display. Overrides ViewsPluginInterface::pluginTitle
PluginBase::preRenderAddFieldsetMarkup public static function Moves form elements into fieldsets for presentation purposes. Overrides ViewsPluginInterface::preRenderAddFieldsetMarkup
PluginBase::preRenderFlattenData public static function Flattens the structure of form elements. Overrides ViewsPluginInterface::preRenderFlattenData
PluginBase::queryLanguageSubstitutions public static function Returns substitutions for Views queries for languages.
PluginBase::setOptionDefaults protected function Fills up the options of the plugin with defaults.
PluginBase::summaryTitle public function Returns the summary of the settings in the display. Overrides ViewsPluginInterface::summaryTitle 6
PluginBase::themeFunctions public function Provide a full list of possible theme templates used by this style. Overrides ViewsPluginInterface::themeFunctions 1
PluginBase::unpackOptions public function Unpack options over our existing defaults, drilling down into arrays so that defaults don't get totally blown away. Overrides ViewsPluginInterface::unpackOptions
PluginBase::usesOptions public function Returns the usesOptions property. Overrides ViewsPluginInterface::usesOptions 8
PluginBase::viewsTokenReplace protected function Replaces Views' tokens in a given string. The resulting string will be sanitized with Xss::filterAdmin. 1
PluginBase::VIEWS_QUERY_LANGUAGE_SITE_DEFAULT constant Query string to indicate the site default language.
SearchApiFilterTrait::opHelper protected function Adds a filter to the search query.
SearchApiFulltext::$parseModeManager protected property The parse mode manager.
SearchApiFulltext::$searchedFields public property The list of fields selected for the search.
SearchApiFulltext::buildExposedForm public function Render our chunk of the exposed filter form when selecting Overrides FilterPluginBase::buildExposedForm
SearchApiFulltext::buildExposeForm public function Options form subform for exposed filter options. Overrides FilterPluginBase::buildExposeForm
SearchApiFulltext::buildOptionsForm public function Provide the basic form which calls through to subforms. If overridden, it is best to call through to the parent, or to at least make sure all of the functions in this form are called. Overrides FilterPluginBase::buildOptionsForm
SearchApiFulltext::create public static function Creates an instance of the plugin. Overrides PluginBase::create
SearchApiFulltext::defaultExposeOptions public function Provide default options for exposed filters. Overrides FilterPluginBase::defaultExposeOptions
SearchApiFulltext::defineOptions public function Information about options for all kinds of purposes will be held here. @code 'option_name' => array( Overrides FilterPluginBase::defineOptions
SearchApiFulltext::exposedTranslate protected function Make some translations to a form item to make it more suitable to exposing. Overrides FilterPluginBase::exposedTranslate
SearchApiFulltext::getFulltextFields protected function Retrieves a list of all available fulltext fields.
SearchApiFulltext::getParseModeManager public function Retrieves the parse mode manager.
SearchApiFulltext::operatorOptions public function Provide a list of options for the default operator form. Should be overridden by classes that don't override operatorForm Overrides FilterPluginBase::operatorOptions
SearchApiFulltext::operators public function Returns information about the available operators for this filter.
SearchApiFulltext::query public function Add this filter to the query. Overrides FilterPluginBase::query
SearchApiFulltext::setParseModeManager public function Sets the parse mode manager.
SearchApiFulltext::showOperatorForm public function Shortcut to display the operator form. Overrides FilterPluginBase::showOperatorForm
SearchApiFulltext::validateExposed public function Validate the exposed handler form Overrides HandlerBase::validateExposed
SearchApiFulltext::valueForm protected function Adds a form for entering the value or values for the filter. Overrides SearchApiFilterTrait::valueForm
SearchApiHandlerTrait::ensureMyTable public function Overrides the Views handlers' ensureMyTable() method.
SearchApiHandlerTrait::getEntityType public function Determines the entity type used by this handler. 1
SearchApiHandlerTrait::getIndex protected function Returns the active search index.
SearchApiHandlerTrait::getQuery public function Retrieves the query plugin.
StringTranslationTrait::$stringTranslation protected property The string translation service. 1
StringTranslationTrait::formatPlural protected function Formats a string containing a count of items.
StringTranslationTrait::getNumberOfPlurals protected function Returns the number of plurals supported by a given language.
StringTranslationTrait::getStringTranslation protected function Gets the string translation service.
StringTranslationTrait::setStringTranslation public function Sets the string translation service to use. 2
StringTranslationTrait::t protected function Translates a string to the current language or to a given language.
TrustedCallbackInterface::THROW_EXCEPTION constant Untrusted callbacks throw exceptions.
TrustedCallbackInterface::TRIGGER_SILENCED_DEPRECATION constant Untrusted callbacks trigger silenced E_USER_DEPRECATION errors.
TrustedCallbackInterface::TRIGGER_WARNING constant Untrusted callbacks trigger E_USER_WARNING errors.