You are here

public static function EntityDataDefinition::create in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php \Drupal\Core\Entity\TypedData\EntityDataDefinition::create()

Creates a new entity definition.

Parameters

string $entity_type_id: (optional) The ID of the entity type, or NULL if the entity type is unknown. Defaults to NULL.

Return value

static

Overrides DataDefinition::create

3 calls to EntityDataDefinition::create()
EntityDataDefinition::createFromDataType in core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php
Creates a new data definition object.
EntityFieldTest::doTestIntrospection in core/modules/system/src/Tests/Entity/EntityFieldTest.php
Executes the introspection tests for the given entity type.
EntityTypedDataDefinitionTest::testEntities in core/modules/system/src/Tests/Entity/EntityTypedDataDefinitionTest.php
Tests deriving metadata about entities.

File

core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php, line 26
Contains \Drupal\Core\Entity\TypedData\EntityDataDefinition.

Class

EntityDataDefinition
A typed data definition class for describing entities.

Namespace

Drupal\Core\Entity\TypedData

Code

public static function create($entity_type_id = NULL) {
  $definition = new static(array());

  // Set the passed entity type.
  if (isset($entity_type_id)) {
    $definition
      ->setEntityTypeId($entity_type_id);
  }
  return $definition;
}