You are here

public function UnsavedIndexConfiguration::enforceIsNew in Search API 8

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.

Return value

$this

Overrides EntityInterface::enforceIsNew

See also

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

File

src/UnsavedIndexConfiguration.php, line 774

Class

UnsavedIndexConfiguration
Represents a configuration of an index that was not yet permanently saved.

Namespace

Drupal\search_api

Code

public function enforceIsNew($value = TRUE) {
  $this->entity
    ->enforceIsNew($value);
  return $this;
}