You are here

public function Index::postCreate in Search API 8

Acts on a created entity before hooks are invoked.

Used after the entity is created, but before saving the entity and before any of the presave hooks are invoked.

See the Entity CRUD topic for more information.

Parameters

\Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object.

Overrides EntityBase::postCreate

See also

\Drupal\Core\Entity\EntityInterface::create()

File

src/Entity/Index.php, line 1223

Class

Index
Defines the search index configuration entity.

Namespace

Drupal\search_api\Entity

Code

public function postCreate(EntityStorageInterface $storage) {
  parent::postCreate($storage);

  // Merge in default options.
  $config = \Drupal::config('search_api.settings');
  $this->options += [
    'cron_limit' => $config
      ->get('default_cron_limit'),
    'index_directly' => TRUE,
  ];
}