protected function TempStore::getDefinitionFromEntity in Multiversion 8
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
\Drupal\Core\Field\FieldStorageDefinitionInterface::getSettings()
1 call to TempStore::getDefinitionFromEntity()
- TempStore::getIds in src/
Plugin/ migrate/ destination/ TempStore.php - Gets the destination IDs.
File
- src/
Plugin/ migrate/ destination/ TempStore.php, line 156
Class
- TempStore
- Plugin annotation @MigrateDestination( id = "tempstore" )
Namespace
Drupal\multiversion\Plugin\migrate\destinationCode
protected function getDefinitionFromEntity($key) {
/** @var \Drupal\Core\Field\FieldStorageDefinitionInterface[] $definitions */
$definitions = $this->entityManager
->getBaseFieldDefinitions($this->entityTypeId);
$field_definition = $definitions[$key];
return [
'type' => $field_definition
->getType(),
] + $field_definition
->getSettings();
}