W3cubDocs

/Drupal 8

protected function EntityStorageBase::doCreate

protected EntityStorageBase::doCreate(array $values)

Performs storage-specific creation of entities.

Parameters

array $values: An array of values to set, keyed by property name.

Return value

\Drupal\Core\Entity\EntityInterface

File

core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 204

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

protected function doCreate(array $values) {
  return new $this->entityClass($values, $this->entityTypeId);
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Entity!EntityStorageBase.php/function/EntityStorageBase::doCreate/8.1.x