You are here

function crumbs_EntityPlugin_Field_Abstract::entityFindCandidate in Crumbs, the Breadcrumbs suite 7.2

Parameters

object $entity: The entity on this path.

string $entity_type: The entity type

string $distinction_key: Typically the bundle name. On user entities, this is one of the roles of the user. (this might be called more than once per user)

Return value

string A candidate for the parent path or title.

Overrides crumbs_EntityPlugin::entityFindCandidate

File

lib/EntityPlugin/Field/Abstract.php, line 50

Class

crumbs_EntityPlugin_Field_Abstract

Code

function entityFindCandidate($entity, $entity_type, $distinction_key) {
  $items = field_get_items($entity_type, $entity, $this->fieldKey);
  if (is_array($items) && !empty($items)) {
    return $this
      ->fieldFindCandidate($items);
  }
  return NULL;
}