function entity_create

Constructs a new entity object, without permanently saving it.

Parameters

$entity_type: The type of the entity.

$values: 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

Drupal\Core\Entity\EntityInterface A new entity object.

136 calls to entity_create()
BreakpointAPITest::testConfigName in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointAPITest.php
Test Breakpoint::buildConfigName().
BreakpointCRUDTest::testBreakpointCRUD in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointCRUDTest.php
Test CRUD operations for breakpoints.
BreakpointGroup::addBreakpointFromMediaQuery in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Plugin/Core/Entity/BreakpointGroup.php
Adds a breakpoint using a name and a media query.
BreakpointGroupAPITest::testConfigName in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupAPITest.php
Test Breakpoint::buildConfigName().
BreakpointGroupCRUDTest::testBreakpointGroupCRUD in drupal/core/modules/breakpoint/lib/Drupal/breakpoint/Tests/BreakpointGroupCRUDTest.php
Test CRUD operations for breakpoint groups.

... See full list

File

drupal/core/includes/entity.inc, line 266
Entity API for handling entities like nodes or users.

Code

function entity_create($entity_type, array $values) {
  return entity_get_controller($entity_type)
    ->create($values);
}