You are here

protected function PropertiesBase::getDrupalFieldType in Salesforce Suite 8.4

Same name and namespace in other branches
  1. 5.0.x modules/salesforce_mapping/src/Plugin/SalesforceMappingField/PropertiesBase.php \Drupal\salesforce_mapping\Plugin\SalesforceMappingField\PropertiesBase::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

1 method overrides PropertiesBase::getDrupalFieldType()
PropertiesExtended::getDrupalFieldType in modules/salesforce_mapping/src/Plugin/SalesforceMappingField/PropertiesExtended.php
Helper method to get the Field Type of the given Field Data Definition.

File

modules/salesforce_mapping/src/Plugin/SalesforceMappingField/PropertiesBase.php, line 251

Class

PropertiesBase
Base class for properties plugins.

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;
}