Implements Drupal\Core\Entity\EntityStorageControllerInterface::create().
Overrides EntityStorageControllerInterface::create
public function create(array $values) {
$class = $this->entityInfo['class'];
$entity = new $class($values, $this->entityType);
// Mark this entity as new, so isNew() returns TRUE. This does not check
// whether a configuration entity with the same ID (if any) already exists.
$entity
->enforceIsNew();
// Assign a new UUID if there is none yet.
if (!isset($entity->{$this->uuidKey})) {
$uuid = new Uuid();
$entity->{$this->uuidKey} = $uuid
->generate();
}
return $entity;
}