You are here

public static function Entity::create in Zircon Profile 8

Same name in this branch
  1. 8 core/lib/Drupal/Core/Entity/Entity.php \Drupal\Core\Entity\Entity::create()
  2. 8 core/modules/views/src/Plugin/views/area/Entity.php \Drupal\views\Plugin\views\area\Entity::create()
  3. 8 core/modules/views/src/Plugin/views/argument_validator/Entity.php \Drupal\views\Plugin\views\argument_validator\Entity::create()
  4. 8 core/modules/migrate/src/Plugin/migrate/destination/Entity.php \Drupal\migrate\Plugin\migrate\destination\Entity::create()
Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/Entity.php \Drupal\Core\Entity\Entity::create()

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 527
Contains \Drupal\Core\Entity\Entity.

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);
}