EntityDataDefinition::create

public static EntityDataDefinition::create($entity_type_id = NULL)

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

File

core/lib/Drupal/Core/Entity/TypedData/EntityDataDefinition.php, line 21

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;
}
doc_Drupal
2016-10-29 09:04:55
Comments
Leave a Comment

Please login to continue.