You are here

public function RoleAccess::preIndexSave in Search API 8

Preprocesses the search index entity before it is saved.

This can, for example, be used to make sure fields needed by this processor are enabled on the index.

Overrides ProcessorPluginBase::preIndexSave

File

src/Plugin/search_api/processor/RoleAccess.php, line 172

Class

RoleAccess
Adds access checks based on user roles.

Namespace

Drupal\search_api\Plugin\search_api\processor

Code

public function preIndexSave() {
  $this
    ->ensureField(NULL, static::ROLE_ACCESS_FIELD, 'string')
    ->setHidden();
}