You are here

private function SearchApiMigrateSubscriber::indexSetReadOnly in Multiversion 8

Set the index read only property state.

Parameters

bool $state: The read only state.

2 calls to SearchApiMigrateSubscriber::indexSetReadOnly()
SearchApiMigrateSubscriber::onPostMigrate in src/EventSubscriber/SearchApiMigrateSubscriber.php
Enable Search API node indexing.
SearchApiMigrateSubscriber::onPreMigrate in src/EventSubscriber/SearchApiMigrateSubscriber.php
Disable Search API node indexing.

File

src/EventSubscriber/SearchApiMigrateSubscriber.php, line 76

Class

SearchApiMigrateSubscriber
SearchApiMigrateSubscriber class.

Namespace

Drupal\multiversion\EventSubscriber

Code

private function indexSetReadOnly($state) {
  foreach ($this->indexes as $index_key => $index) {
    $index
      ->set('read_only', $state);
    $index
      ->save();
  }
}