function TypedDataRelationship::getRelationshipValue

Same name in other branches
  1. 4.0.x src/Plugin/Relationship/TypedDataRelationship.php \Drupal\ctools\Plugin\Relationship\TypedDataRelationship::getRelationshipValue()

File

src/Plugin/Relationship/TypedDataRelationship.php, line 85

Class

TypedDataRelationship
Plugin annotation @Relationship( id = "typed_data_relationship", deriver = "\Drupal\ctools\Plugin\Deriver\TypedDataRelationshipDeriver" )

Namespace

Drupal\ctools\Plugin\Relationship

Code

public function getRelationshipValue() {
    $property = $this->getMainPropertyName();
    
    /** @var \Drupal\Core\TypedData\ComplexDataInterface $data */
    $data = $this->getRelationship()
        ->getContextData();
    $data->get($property)
        ->getValue();
}