You are here

public function EntityBase::isNew in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::isNew()
  2. 9 core/lib/Drupal/Core/Entity/EntityBase.php \Drupal\Core\Entity\EntityBase::isNew()
6 calls to EntityBase::isNew()
ContentEntityBase::hasTranslationChanges in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Determines if the current translation of the entity has unsaved changes.
ContentEntityBase::isDefaultRevision in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Checks if this entity is the default revision.
ContentEntityBase::onChange in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Reacts to changes to a field.
ContentEntityBase::wasDefaultRevision in core/lib/Drupal/Core/Entity/ContentEntityBase.php
Checks whether the entity object was a default revision when it was saved.
Media::getThumbnailUri in core/modules/media/src/Entity/Media.php
Gets the URI for the thumbnail of a media item.

... See full list

1 method overrides EntityBase::isNew()
ConfigEntityBase::isNew in core/lib/Drupal/Core/Config/Entity/ConfigEntityBase.php
Overrides Entity::isNew().

File

core/lib/Drupal/Core/Entity/EntityBase.php, line 120

Class

EntityBase
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

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