public function ViewsSelection::validateReferenceableEntities in Drupal 9
Same name and namespace in other branches
- 8 core/modules/views/src/Plugin/EntityReferenceSelection/ViewsSelection.php \Drupal\views\Plugin\EntityReferenceSelection\ViewsSelection::validateReferenceableEntities()
Validates which existing entities can be referenced.
Parameters
array $ids: An array of IDs to validate.
Return value
array An array of valid entity IDs.
Overrides SelectionInterface::validateReferenceableEntities
File
- core/
modules/ views/ src/ Plugin/ EntityReferenceSelection/ ViewsSelection.php, line 306
Class
- ViewsSelection
- Plugin implementation of the 'selection' entity_reference.
Namespace
Drupal\views\Plugin\EntityReferenceSelectionCode
public function validateReferenceableEntities(array $ids) {
$entities = $this
->getDisplayExecutionResults(NULL, 'CONTAINS', 0, $ids);
$result = [];
if ($entities) {
$result = array_keys($entities);
}
return $result;
}