You are here

public function ResourceFieldReference::compoundDocumentId in RESTful 7.2

Overrides ResourceField::compoundDocumentId().

Overrides ResourceField::compoundDocumentId

File

src/Plugin/resource/Field/ResourceFieldReference.php, line 34
Contains \Drupal\restful\Plugin\resource\Field\ResourceFieldReference.

Class

ResourceFieldReference
Class ResourceFieldReference.

Namespace

Drupal\restful\Plugin\resource\Field

Code

public function compoundDocumentId(DataInterpreterInterface $interpreter) {
  $collection = parent::compoundDocumentId($interpreter);
  if (!$collection instanceof ResourceFieldCollectionInterface) {
    return NULL;
  }
  $id_field = $collection
    ->getIdField();
  if (!$id_field instanceof ResourceFieldInterface) {
    return NULL;
  }
  return $id_field
    ->render($collection
    ->getInterpreter());
}