class TypedDataEntityRelationship
Same name in other branches
- 8.x-3.x src/Plugin/Relationship/TypedDataEntityRelationship.php \Drupal\ctools\Plugin\Relationship\TypedDataEntityRelationship
Plugin annotation
@Relationship(
id = "typed_data_entity_relationship",
deriver = "\Drupal\ctools\Plugin\Deriver\TypedDataEntityRelationshipDeriver"
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
- class \Drupal\ctools\Plugin\RelationshipBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\ctools\Plugin\RelationshipInterface uses \Drupal\Core\Plugin\ContextAwarePluginTrait
- class \Drupal\ctools\Plugin\Relationship\TypedDataRelationship extends \Drupal\ctools\Plugin\RelationshipBase
- class \Drupal\ctools\Plugin\Relationship\TypedDataEntityRelationship extends \Drupal\ctools\Plugin\Relationship\TypedDataRelationship
- class \Drupal\ctools\Plugin\Relationship\TypedDataRelationship extends \Drupal\ctools\Plugin\RelationshipBase
- class \Drupal\ctools\Plugin\RelationshipBase extends \Drupal\Core\Plugin\PluginBase implements \Drupal\ctools\Plugin\RelationshipInterface uses \Drupal\Core\Plugin\ContextAwarePluginTrait
- class \Drupal\Core\Plugin\PluginBase extends \Drupal\Component\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait
Expanded class hierarchy of TypedDataEntityRelationship
File
-
src/
Plugin/ Relationship/ TypedDataEntityRelationship.php, line 14
Namespace
Drupal\ctools\Plugin\RelationshipView source
class TypedDataEntityRelationship extends TypedDataRelationship {
/**
* {@inheritdoc}
*/
public function getRelationship() {
$plugin_definition = $this->getPluginDefinition();
$context_definition = new EntityContextDefinition("entity:{$plugin_definition['target_entity_type']}", $plugin_definition['label']);
$context_value = NULL;
// If the 'base' context has a value, then get the property value to put on
// the context (otherwise, mapping hasn't occurred yet and we just want to
// return the context with the right definition and no value).
if ($this->getContext('base')
->hasContextValue()) {
$data = $this->getData($this->getContext('base'));
if ($data) {
$context_value = $data->entity;
}
}
$context_definition->setDefaultValue($context_value);
return new Context($context_definition, $context_value);
}
}
Members
Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
---|---|---|---|---|
TypedDataEntityRelationship::getRelationship | public | function | Overrides TypedDataRelationship::getRelationship | |
TypedDataRelationship::getData | protected | function | ||
TypedDataRelationship::getMainPropertyName | protected | function | ||
TypedDataRelationship::getName | public | function | ||
TypedDataRelationship::getRelationshipValue | public | function |