8.3.x Entity.php public static Entity::create(array $values = [])
8.3.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL)
8.3.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
8.3.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
8.0.x Entity.php public static Entity::create(array $values = array())
8.0.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL)
8.0.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
8.0.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
8.1.x Entity.php public static Entity::create(array $values = array())
8.1.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL)
8.1.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
8.1.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
8.2.x Entity.php public static Entity::create(array $values = array())
8.2.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL)
8.2.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
8.2.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
8.4.x Entity.php public static Entity::create(array $values = [])
8.4.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition, MigrationInterface $migration = NULL)
8.4.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)
8.4.x Entity.php public static Entity::create(ContainerInterface $container, array $configuration, $plugin_id, $plugin_definition)

Constructs a new entity object, without permanently saving it.

Parameters

array $values: (optional) An array of values to set, keyed by property name. If the entity type has bundles, the bundle key has to be specified.

Return value

static The entity object.

Overrides EntityInterface::create

1 call to Entity::create()
ConfigurableLanguage::createFromLangcode in core/modules/language/src/Entity/ConfigurableLanguage.php
Creates a configurable language object from a langcode.

File

core/lib/Drupal/Core/Entity/Entity.php, line 513

Class

Entity
Defines a base entity class.

Namespace

Drupal\Core\Entity

Code

public static function create(array $values = array()) {
  $entity_manager = \Drupal::entityManager();
  return $entity_manager->getStorage($entity_manager->getEntityTypeFromClass(get_called_class()))->create($values);
}