class TypedDataLanguageRelationshipDeriver in Chaos Tool Suite (ctools) 8.3
Hierarchy
- class \Drupal\Component\Plugin\Derivative\DeriverBase implements DeriverInterface
- class \Drupal\ctools\Plugin\Deriver\TypedDataPropertyDeriverBase implements ContainerDeriverInterface uses StringTranslationTrait
- class \Drupal\ctools\Plugin\Deriver\TypedDataRelationshipDeriver implements ContainerDeriverInterface
- class \Drupal\ctools\Plugin\Deriver\TypedDataLanguageRelationshipDeriver
- class \Drupal\ctools\Plugin\Deriver\TypedDataRelationshipDeriver implements ContainerDeriverInterface
- class \Drupal\ctools\Plugin\Deriver\TypedDataPropertyDeriverBase implements ContainerDeriverInterface uses StringTranslationTrait
Expanded class hierarchy of TypedDataLanguageRelationshipDeriver
File
- src/
Plugin/ Deriver/ TypedDataLanguageRelationshipDeriver.php, line 8
Namespace
Drupal\ctools\Plugin\DeriverView source
class TypedDataLanguageRelationshipDeriver extends TypedDataRelationshipDeriver {
/**
* {@inheritdoc}
*
* @todo this results in awful labels like "Language Language from Content"
* Fix it.
*/
protected $label = '@property Language from @base';
/**
* {@inheritdoc}
*/
protected function generateDerivativeDefinition($base_plugin_definition, $data_type_id, $data_type_definition, DataDefinitionInterface $base_definition, $property_name, DataDefinitionInterface $property_definition) {
if (method_exists($property_definition, 'getType') && $property_definition
->getType() == 'language') {
parent::generateDerivativeDefinition($base_plugin_definition, $data_type_id, $data_type_definition, $base_definition, $property_name, $property_definition);
}
}
/**
* {@inheritdoc}
*/
public function getDerivativeDefinitions($base_plugin_definition) {
parent::getDerivativeDefinitions($base_plugin_definition);
// The data types will all be set to string since language extends string
// and the parent class finds the related primitive.
foreach ($this->derivatives as $plugin_id => $derivative) {
$this->derivatives[$plugin_id]['data_type'] = 'language';
}
return $this->derivatives;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DeriverBase:: |
protected | property | List of derivative definitions. | 1 |
DeriverBase:: |
public | function |
Gets the definition of a derivative plugin. Overrides DeriverInterface:: |
|
StringTranslationTrait:: |
protected | property | The string translation service. | 1 |
StringTranslationTrait:: |
protected | function | Formats a string containing a count of items. | |
StringTranslationTrait:: |
protected | function | Returns the number of plurals supported by a given language. | |
StringTranslationTrait:: |
protected | function | Gets the string translation service. | |
StringTranslationTrait:: |
public | function | Sets the string translation service to use. | 2 |
StringTranslationTrait:: |
protected | function | Translates a string to the current language or to a given language. | |
TypedDataLanguageRelationshipDeriver:: |
protected | property |
@todo this results in awful labels like "Language Language from Content"
Fix it. Overrides TypedDataPropertyDeriverBase:: |
|
TypedDataLanguageRelationshipDeriver:: |
protected | function |
Generates and maintains a derivative definition. Overrides TypedDataRelationshipDeriver:: |
|
TypedDataLanguageRelationshipDeriver:: |
public | function |
Gets the definition of all derivatives of a base plugin. Overrides TypedDataPropertyDeriverBase:: |
|
TypedDataPropertyDeriverBase:: |
protected | property | ||
TypedDataPropertyDeriverBase:: |
public static | function |
Creates a new class instance. Overrides ContainerDeriverInterface:: |
|
TypedDataPropertyDeriverBase:: |
protected | function | ||
TypedDataPropertyDeriverBase:: |
public | function | TypedDataPropertyDeriverBase constructor. |