protected EntityStorageBase::doPostSave(EntityInterface $entity, $update)
Performs post save entity processing.
\Drupal\Core\Entity\EntityInterface $entity: The saved entity.
bool $update: Specifies whether the entity is being updated or created.
protected function doPostSave(EntityInterface $entity, $update) { $this->resetCache(array($entity->id())); // The entity is no longer new. $entity->enforceIsNew(FALSE); // Allow code to run after saving. $entity->postSave($this, $update); $this->invokeHook($update ? 'update' : 'insert', $entity); // After saving, this is now the "original entity", and subsequent saves // will be updates instead of inserts, and updates must always be able to // correctly identify the original entity. $entity->setOriginalId($entity->id()); unset($entity->original); }
© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityStorageBase.php/function/EntityStorageBase::doPostSave/8.1.x