public function ContentEntityBase::postCreate

public ContentEntityBase::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 Entity::postCreate

See also

\Drupal\Core\Entity\EntityInterface::create()

File

core/lib/Drupal/Core/Entity/ContentEntityBase.php, line 254

Class

ContentEntityBase
Implements Entity Field API specific enhancements to the Entity class.

Namespace

Drupal\Core\Entity

Code

public function postCreate(EntityStorageInterface $storage) {
  $this->newRevision = TRUE;
}

© 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!ContentEntityBase.php/function/ContentEntityBase::postCreate/8.1.x