Overrides DatabaseStorageController::create().
array $values: An array of values to set, keyed by field name. The value has to be the plain value of an entity field, i.e. an array of field items. If no numerically indexed array is given, the value will be set for the first field item. For example, to set the first item of a 'name' field one can pass:
$values = array(
'name' => array(
0 => array(
'value' => 'the name',
),
),
);
or
$values = array(
'name' => array(
'value' => 'the name',
),
);
If the 'name' field is a defined as 'string_item' which supports setting its value by a string, it's also possible to just pass the name string:
$values = array(
'name' => 'the name',
);
\Drupal\Core\Entity\EntityInterface A new entity object.
Overrides DatabaseStorageControllerNG::create
public function create(array $values) {
if (empty($values['type'])) {
$values['type'] = $this->entityType;
}
return parent::create($values);
}