protected EntityStorageBase::doPostSave(EntityInterface $entity, $update)
Performs post save entity processing.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The saved entity.
bool $update: Specifies whether the entity is being updated or created.
File
- core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 462
Class
- EntityStorageBase
- A base entity storage class.
Namespace
Drupal\Core\Entity
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 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); } |
Please login to continue.