You are here

protected function DataProviderEntity::getReferencedIds in RESTful 7.2

Get reference IDs for multiple values.

Parameters

array $values: The provided values, they can be an IDs or not.

ResourceFieldInterface $resource_field: The resource field that points to another entity.

Return value

string If the field uses an alternate ID property, then the ID gets translated to the original entity ID. If not, then the same provided ID is returned.

See also

getReferencedId()

1 call to DataProviderEntity::getReferencedIds()
DataProviderEntity::queryForListFilter in src/Plugin/resource/DataProvider/DataProviderEntity.php
Filter the query for list.

File

src/Plugin/resource/DataProvider/DataProviderEntity.php, line 1208
Contains \Drupal\restful\Plugin\resource\DataProvider\DataProviderEntity.

Class

DataProviderEntity
Class DataProviderEntity.

Namespace

Drupal\restful\Plugin\resource\DataProvider

Code

protected function getReferencedIds(array $values, ResourceFieldInterface $resource_field) {
  $output = array();
  foreach ($values as $value) {
    $output[] = $this
      ->getReferencedId($value, $resource_field);
  }
  return $output;
}