function TypedDataPropertyDeriverBase::getDataType

Same name in other branches
  1. 4.0.x src/Plugin/Deriver/TypedDataPropertyDeriverBase.php \Drupal\ctools\Plugin\Deriver\TypedDataPropertyDeriverBase::getDataType()

Parameters

$property_definition:

Return value

mixed

File

src/Plugin/Deriver/TypedDataPropertyDeriverBase.php, line 83

Class

TypedDataPropertyDeriverBase

Namespace

Drupal\ctools\Plugin\Deriver

Code

protected function getDataType($property_definition) {
    if ($property_definition instanceof DataReferenceDefinitionInterface) {
        return $property_definition->getTargetDefinition()
            ->getDataType();
    }
    if ($property_definition instanceof ListDataDefinitionInterface) {
        return $property_definition->getItemDefinition()
            ->getDataType();
    }
    return $property_definition->getDataType();
}