You are here

public function EntityTestBundleClass::postCreate in Drupal 10

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

See also

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

File

core/modules/system/tests/modules/entity_test_bundle_class/src/Entity/EntityTestBundleClass.php, line 68

Class

EntityTestBundleClass
The bundle class for the bundle_class bundle of the entity_test entity.

Namespace

Drupal\entity_test_bundle_class\Entity

Code

public function postCreate(EntityStorageInterface $storage) {
  parent::postCreate($storage);
  $this->postCreateCount++;
}