You are here

public function TestBackend::preUpdate in Search API 8

Notifies the backend that its configuration is about to be updated.

The server's $original property can be used to inspect the old configuration values.

Take care, though, that the server at this point might be override-free and thus contain property values (and apparent changes) which will not actually go into effect. If this might influence the code in this method, you have to manually check for overrides to ensure no incorrect action is taken.

Overrides BackendPluginBase::preUpdate

See also

\Drupal\search_api\Utility\Utility::getConfigOverrides()

File

tests/search_api_test/src/Plugin/search_api/backend/TestBackend.php, line 44

Class

TestBackend
Provides a dummy backend for testing purposes.

Namespace

Drupal\search_api_test\Plugin\search_api\backend

Code

public function preUpdate() {
  if ($override = $this
    ->getMethodOverride(__FUNCTION__)) {
    call_user_func($override, $this);
    return;
  }
  $this
    ->checkError(__FUNCTION__);
}