You are here

public function TestActionTrait::execute in Search API 8

File

tests/search_api_test_bulk_form/src/Plugin/Action/TestActionTrait.php, line 24

Class

TestActionTrait
Reusable code for test actions.

Namespace

Drupal\search_api_test_bulk_form\Plugin\Action

Code

public function execute(EntityInterface $entity = NULL) {
  $result = \Drupal::state()
    ->get('search_api_test_bulk_form', []);
  $result[] = [
    $this
      ->getPluginId(),
    $entity
      ->getEntityTypeId(),
    $entity
      ->id(),
  ];
  \Drupal::state()
    ->set('search_api_test_bulk_form', $result);
}