protected function PropertiesExtended::getFieldDataDefinition in Salesforce Suite 8.3
Helper method to get the Data Definition for the current field.
Parameters
\Drupal\Core\Entity\EntityInterface $entity: The Entity to get the field from.
Return value
\Drupal\Core\TypedData\DataDefinitionInterface The Data Definition of the current field.
Overrides SalesforceMappingFieldPluginBase::getFieldDataDefinition
File
- modules/
salesforce_mapping/ src/ Plugin/ SalesforceMappingField/ PropertiesExtended.php, line 341
Class
- PropertiesExtended
- Adapter for entity properties and fields.
Namespace
Drupal\salesforce_mapping\Plugin\SalesforceMappingFieldCode
protected function getFieldDataDefinition(EntityInterface $entity) {
$data_definition = $this
->getDataFetcher()
->fetchDefinitionByPropertyPath($entity
->getTypedData()
->getDataDefinition(), $this
->config('drupal_field_value'));
if ($data_definition instanceof ListDataDefinitionInterface) {
$data_definition = $data_definition
->getItemDefinition();
}
return $data_definition;
}