1 EntityReferenceSelectionHandlerGeneric.inc public EntityReferenceSelectionHandlerGeneric::validateReferencableEntities(array $ids)

Implements EntityReferenceHandler::validateReferencableEntities().

Overrides EntityReferenceSelectionHandlerInterface::validateReferencableEntities

File

core/modules/entityreference/plugins/selection/EntityReferenceSelectionHandlerGeneric.inc, line 218
Generic Entity handler.

Class

EntityReferenceSelectionHandlerGeneric
@file Generic Entity handler.

Code

public function validateReferencableEntities(array $ids) {
  if ($ids) {
    $entity_type = $this->field['settings']['target_type'];
    $query = $this->buildEntityFieldQuery();
    $query->entityCondition('entity_id', $ids, 'IN');
    $result = $query->execute();
    if (!empty($result[$entity_type])) {
      return array_keys($result[$entity_type]);
    }
  }

  return array();
}