You are here

public function EntityOperations::entityInsert in Config Entity Revisions 8.2

Respond to the addition of an entity.

Parameters

\Drupal\Core\Entity\EntityInterface $entity: The entity that was just saved.

See also

hook_entity_insert()

File

src/EntityOperations.php, line 139

Class

EntityOperations
Defines a class for reacting to entity events.

Namespace

Drupal\config_entity_revisions

Code

public function entityInsert(EntityInterface $entity) {
  if ($this->moderationInfo
    ->isModeratedEntity($entity)) {
    $this
      ->updateOrCreateFromEntity($entity);
  }
}