You are here

public function ResourceField::compoundDocumentId in RESTful 7.2

Fetches the embedded identifier(s) for the current resource field, if any.

Parameters

DataInterpreterInterface $interpreter: The data interpreter to get the compound ID.

Return value

string|string[] An identifier or an array of identifiers for cardinality > 1. NULL if there is no identifier to be found.

Overrides ResourceFieldInterface::compoundDocumentId

1 call to ResourceField::compoundDocumentId()
ResourceFieldReference::compoundDocumentId in src/Plugin/resource/Field/ResourceFieldReference.php
Overrides ResourceField::compoundDocumentId().
1 method overrides ResourceField::compoundDocumentId()
ResourceFieldReference::compoundDocumentId in src/Plugin/resource/Field/ResourceFieldReference.php
Overrides ResourceField::compoundDocumentId().

File

src/Plugin/resource/Field/ResourceField.php, line 180
Contains \Drupal\restful\Plugin\resource\ResourceField.

Class

ResourceField

Namespace

Drupal\restful\Plugin\resource\Field

Code

public function compoundDocumentId(DataInterpreterInterface $interpreter) {

  // Since this kind of field can be anything, just return the value.
  return $this
    ->value($interpreter);
}