Implements \Drupal\Core\Entity\EntityStorageControllerInterface::create().
Overrides EntityStorageControllerInterface::create
public function create(array $values) {
$class = $this->entityInfo['class'];
$entity = new $class($values, $this->entityType);
// Assign a new UUID if there is none yet.
if ($this->uuidKey && !isset($entity->{$this->uuidKey})) {
$uuid = new Uuid();
$entity->{$this->uuidKey} = $uuid
->generate();
}
// Modules might need to add or change the data initially held by the new
// entity object, for instance to fill-in default values.
$this
->invokeHook('create', $entity);
return $entity;
}