Entity::setOriginalId

public Entity::setOriginalId($id) Sets the original ID. Parameters int|string|null $id: The new ID to set as original ID. If the entity supports renames, setting NULL will prevent an update from being considered a rename. Return value $this Overrides EntityInterface::setOriginalId File core/lib/Drupal/Core/Entity/Entity.php, line 573 Class Entity Defines a base entity class. Namespace Drupal\Core\Entity Code public function setOriginalId($id) { // By default, entities do not suppor

Entity::save

public Entity::save() Saves an entity permanently. When saving existing entities, the entity is assumed to be complete, partial updates of entities are not supported. Return value int Either SAVED_NEW or SAVED_UPDATED, depending on the operation performed. Throws \Drupal\Core\Entity\EntityStorageException In case of failures an exception is thrown. Overrides EntityInterface::save File core/lib/Drupal/Core/Entity/Entity.php, line 363 Class Entity Defines a base entity class. Namespace

Entity::referencedEntities

public Entity::referencedEntities() Gets a list of entities referenced by this entity. Return value \Drupal\Core\Entity\EntityInterface[] An array of entities. Overrides EntityInterface::referencedEntities File core/lib/Drupal/Core/Entity/Entity.php, line 454 Class Entity Defines a base entity class. Namespace Drupal\Core\Entity Code public function referencedEntities() { return array(); }

Entity::preSave

public Entity::preSave(EntityStorageInterface $storage) Acts on an entity before the presave hook is invoked. Used before the entity is saved and before invoking the presave hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed. This is different from its counterpart in the Field API, FieldItemListInterface::preSave(), which is fired on all field translations automat

Entity::preDelete

public static Entity::preDelete(EntityStorageInterface $storage, array $entities) Acts on entities before they are deleted and before hooks are invoked. Used before the entities are deleted and before invoking the delete hook. Parameters \Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object. \Drupal\Core\Entity\EntityInterface[] $entities: An array of entities. Overrides EntityInterface::preDelete File core/lib/Drupal/Core/Entity/Entity.php, line 435 Class Entity

Entity::preCreate

public static Entity::preCreate(EntityStorageInterface $storage, array &$values) Changes the values of an entity before it is created. Load defaults for example. Parameters \Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object. mixed[] $values: An array of values to set, keyed by property name. If the entity type has bundles the bundle key has to be specified. Overrides EntityInterface::preCreate File core/lib/Drupal/Core/Entity/Entity.php, line 423 Class Entit

Entity::postSave

public Entity::postSave(EntityStorageInterface $storage, $update = TRUE) Acts on a saved entity before the insert or update hook is invoked. Used after the entity is saved, but before invoking the insert or update hook. Note that in case of translatable content entities this callback is only fired on their current translation. It is up to the developer to iterate over all translations if needed. Parameters \Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object. bool $up

Entity::postLoad

public static Entity::postLoad(EntityStorageInterface $storage, array &$entities) Acts on loaded entities. Parameters \Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object. \Drupal\Core\Entity\EntityInterface[] $entities: An array of entities. Overrides EntityInterface::postLoad File core/lib/Drupal/Core/Entity/Entity.php, line 448 Class Entity Defines a base entity class. Namespace Drupal\Core\Entity Code public static function postLoad(EntityStorageInter

Entity::postDelete

public static Entity::postDelete(EntityStorageInterface $storage, array $entities) Acts on deleted entities before the delete hook is invoked. Used after the entities are deleted but before invoking the delete hook. Parameters \Drupal\Core\Entity\EntityStorageInterface $storage: The entity storage object. \Drupal\Core\Entity\EntityInterface[] $entities: An array of entities. Overrides EntityInterface::postDelete File core/lib/Drupal/Core/Entity/Entity.php, line 441 Class Entity Defines a

Entity::postCreate

public Entity::postCreate(EntityStorageInterface $storage) 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 EntityInterface::postCreate See also \Drupal\Core\Entity\EntityInterface::create() File core/lib/Drupal/Core/Entity/Entity.php