public function EntityStorageControllerInterface::getFieldDefinitions

Gets an array of entity field definitions.

If a 'bundle' key is present in the given entity definition, fields specific to this bundle are included. Entity fields are always multi-valued, so 'list' is TRUE for each returned field definition.

Parameters

array $constraints: An array of entity constraints as used for entities in typed data definitions, i.e. an array having an 'entity type' and optionally a 'bundle' key. For example:

array(
  'entity type' => 'node',
  'bundle' => 'article',
);

Return value

array An array of field definitions of entity fields, keyed by field name. In addition to the typed data definition keys as described at typed_data()->create() the follow keys are supported:

  • queryable: Whether the field is queryable via QueryInterface. Defaults to TRUE if 'computed' is FALSE or not set, to FALSE otherwise.
  • translatable: Whether the field is translatable. Defaults to FALSE.
  • configurable: A boolean indicating whether the field is configurable via field.module. Defaults to FALSE.

See also

Drupal\Core\TypedData\TypedDataManager::create()

typed_data()

File

drupal/core/lib/Drupal/Core/Entity/EntityStorageControllerInterface.php, line 146
Definition of Drupal\Core\Entity\EntityStorageControllerInterface.

Class

EntityStorageControllerInterface
Defines a common interface for entity controller classes.

Namespace

Drupal\Core\Entity

Code

public function getFieldDefinitions(array $constraints);