ContentEntityStorageBase::invokeFieldPostSave

protected ContentEntityStorageBase::invokeFieldPostSave(ContentEntityInterface $entity, $update)

Invokes the post save method on the Field objects within an entity.

Parameters

\Drupal\Core\Entity\ContentEntityInterface $entity: The entity object.

bool $update: Specifies whether the entity is being updated or created.

File

core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 484

Class

ContentEntityStorageBase
Base class for content entity storage handlers.

Namespace

Drupal\Core\Entity

Code

protected function invokeFieldPostSave(ContentEntityInterface $entity, $update) {
  // For each entity translation this returns an array of resave flags keyed
  // by field name, thus we merge them to obtain a list of fields to resave.
  $resave = [];
  foreach ($this->invokeFieldMethod('postSave', $entity, $update) as $translation_results) {
    $resave += array_filter($translation_results);
  }
  if ($resave) {
    $this->doSaveFieldItems($entity, array_keys($resave));
  }
}
doc_Drupal
2016-10-29 08:57:34
Comments
Leave a Comment

Please login to continue.