function TypedDataPropertyDeriverBase::getDerivativeDefinitions

Same name in other branches
  1. 8.x-3.x src/Plugin/Deriver/TypedDataPropertyDeriverBase.php \Drupal\ctools\Plugin\Deriver\TypedDataPropertyDeriverBase::getDerivativeDefinitions()

Overrides DeriverBase::getDerivativeDefinitions

1 call to TypedDataPropertyDeriverBase::getDerivativeDefinitions()
TypedDataLanguageRelationshipDeriver::getDerivativeDefinitions in src/Plugin/Deriver/TypedDataLanguageRelationshipDeriver.php
Gets the definition of all derivatives of a base plugin.
1 method overrides TypedDataPropertyDeriverBase::getDerivativeDefinitions()
TypedDataLanguageRelationshipDeriver::getDerivativeDefinitions in src/Plugin/Deriver/TypedDataLanguageRelationshipDeriver.php
Gets the definition of all derivatives of a base plugin.

File

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

Class

TypedDataPropertyDeriverBase

Namespace

Drupal\ctools\Plugin\Deriver

Code

public function getDerivativeDefinitions($base_plugin_definition) {
    foreach ($this->typedDataManager
        ->getDefinitions() as $data_type_id => $data_type_definition) {
        if (is_subclass_of($data_type_definition['class'], ComplexDataInterface::class, TRUE)) {
            
            /** @var \Drupal\Core\TypedData\ComplexDataDefinitionInterface $base_definition */
            $base_definition = $this->typedDataManager
                ->createDataDefinition($data_type_id);
            foreach ($base_definition->getPropertyDefinitions() as $property_name => $property_definition) {
                if ($property_definition instanceof BaseFieldDefinition || $property_definition instanceof FieldConfig) {
                    $this->generateDerivativeDefinition($base_plugin_definition, $data_type_id, $data_type_definition, $base_definition, $property_name, $property_definition);
                }
            }
        }
    }
    return $this->derivatives;
}