trait EntityFieldDefinitionTrait (View source)

The entity field definition trait.

Methods

array
getDefinitionFromEntity(string $key)

Gets the field definition from a specific entity base field.

static string
getEntityTypeId(string $plugin_id)

Finds the entity type from configuration or plugin ID.

Details

protected array getDefinitionFromEntity(string $key)

Gets the field definition from a specific entity base field.

The method takes the field ID as an argument and returns the field storage definition to be used in getIds() by querying the destination entity base field definition.

Parameters

string $key

The field ID key.

Return Value

array

An associative array with a structure that contains the field type, keyed as 'type', together with field storage settings as they are returned by FieldStorageDefinitionInterface::getSettings().

See also

FieldStorageDefinitionInterface::getSettings

static protected string getEntityTypeId(string $plugin_id)

Finds the entity type from configuration or plugin ID.

Parameters

string $plugin_id

The plugin ID.

Return Value

string

The entity type.