public function ContentEntityBase::postCreate in Drupal 10
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::postCreate()
- 9 core/lib/Drupal/Core/Entity/ContentEntityBase.php \Drupal\Core\Entity\ContentEntityBase::postCreate()
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 EntityBase::postCreate
See also
\Drupal\Core\Entity\EntityInterface::create()
1 method overrides ContentEntityBase::postCreate()
- EntityTestBundleClass::postCreate in core/
modules/ system/ tests/ modules/ entity_test_bundle_class/ src/ Entity/ EntityTestBundleClass.php - Acts on a created entity before hooks are invoked.
File
- core/
lib/ Drupal/ Core/ Entity/ ContentEntityBase.php, line 284
Class
- ContentEntityBase
- Implements Entity Field API specific enhancements to the Entity class.
Namespace
Drupal\Core\EntityCode
public function postCreate(EntityStorageInterface $storage) {
$this->newRevision = TRUE;
}