1 EntityReferenceSelectionHandlerGeneric.inc public EntityReferenceSelectionHandlerGeneric::getLabel($entity)

Implements EntityReferenceHandler::getLabel().

Overrides EntityReferenceSelectionHandlerInterface::getLabel

File

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

Class

EntityReferenceSelectionHandlerGeneric
@file Generic Entity handler.

Code

public function getLabel($entity) {
  $target_type = $this->field['settings']['target_type'];
  return entity_access('view', $target_type, $entity) ? entity_label($target_type, $entity) : t(ENTITYREFERENCE_DENIED);
}