function ConfigEntityBase::isNew

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php \Drupal\Core\Config\Entity\ConfigEntityBase::isNew()
  2. 10 core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php \Drupal\Core\Config\Entity\ConfigEntityBase::isNew()
  3. 8.9.x core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php \Drupal\Core\Config\Entity\ConfigEntityBase::isNew()

Overrides Entity::isNew().

EntityInterface::enforceIsNew() is only supported for newly created configuration entities but has no effect after saving, since each configuration entity is unique.

2 calls to ConfigEntityBase::isNew()
FieldConfig::preSave in core/modules/field/src/Entity/FieldConfig.php
Overrides \Drupal\Core\Entity\Entity::preSave().
FieldStorageConfig::preSave in core/modules/field/src/Entity/FieldStorageConfig.php
Overrides \Drupal\Core\Entity\Entity::preSave().

File

core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php, line 146

Class

ConfigEntityBase
Defines a base configuration entity class.

Namespace

Drupal\Core\Config\Entity

Code

public function isNew() {
  return !empty($this->enforceIsNew);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.