You are here

protected function PropertiesExtended::getDrupalFieldType in Salesforce Suite 8.3

Same name and namespace in other branches
  1. 8.4 modules/salesforce_mapping/src/Plugin/SalesforceMappingField/PropertiesExtended.php \Drupal\salesforce_mapping\Plugin\SalesforceMappingField\PropertiesExtended::getDrupalFieldType()
  2. 5.0.x modules/salesforce_mapping/src/Plugin/SalesforceMappingField/PropertiesExtended.php \Drupal\salesforce_mapping\Plugin\SalesforceMappingField\PropertiesExtended::getDrupalFieldType()

Helper method to get the Field Type of the given Field Data Definition.

Parameters

\Drupal\Core\TypedData\DataDefinitionInterface $data_definition: The Drupal Field Data Definition object.

Return value

string|null The Drupal Field Type or NULL.

Overrides SalesforceMappingFieldPluginBase::getDrupalFieldType

File

modules/salesforce_mapping/src/Plugin/SalesforceMappingField/PropertiesExtended.php, line 353

Class

PropertiesExtended
Adapter for entity properties and fields.

Namespace

Drupal\salesforce_mapping\Plugin\SalesforceMappingField

Code

protected function getDrupalFieldType(DataDefinitionInterface $data_definition) {
  $field_main_property = $data_definition;
  if ($data_definition instanceof ComplexDataDefinitionInterface) {
    $field_main_property = $data_definition
      ->getPropertyDefinition($data_definition
      ->getMainPropertyName());
  }
  return $field_main_property ? $field_main_property
    ->getDataType() : NULL;
}