public function EntityInterface::enforceIsNew

Enforces an entity to be new.

Allows migrations to create entities with pre-defined IDs by forcing the entity to be new before saving.

Parameters

bool $value: (optional) Whether the entity should be forced to be new. Defaults to TRUE.

See also

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

2 methods override EntityInterface::enforceIsNew()
Entity::enforceIsNew in drupal/core/lib/Drupal/Core/Entity/Entity.php
Implements EntityInterface::enforceIsNew().
ViewUI::enforceIsNew in drupal/core/modules/views/views_ui/lib/Drupal/views_ui/ViewUI.php
Implements \Drupal\Core\Entity\EntityInterface::enforceIsNew().

File

drupal/core/lib/Drupal/Core/Entity/EntityInterface.php, line 87
Definition of Drupal\Core\Entity\EntityInterface.

Class

EntityInterface
Defines a common interface for all entity objects.

Namespace

Drupal\Core\Entity

Code

public function enforceIsNew($value = TRUE);