You are here

protected function crumbs_MultiPlugin_EntityFindSomething::entityFind in Crumbs, the Breadcrumbs suite 7.2

Parameters

stdClass $entity:

Return value

array

1 call to crumbs_MultiPlugin_EntityFindSomething::entityFind()
crumbs_MultiPlugin_EntityFindSomething::find in lib/MultiPlugin/EntityFindSomething.php

File

lib/MultiPlugin/EntityFindSomething.php, line 97

Class

crumbs_MultiPlugin_EntityFindSomething

Code

protected function entityFind(stdClass $entity) {
  if (!empty($this->bundleKey) && !empty($entity->{$this->bundleKey})) {
    $distinction_key = $entity->{$this->bundleKey};
  }
  else {
    $distinction_key = $this->entityType;
  }
  $parent = $this->plugin
    ->entityFindCandidate($entity, $this->entityType, $distinction_key);
  if (!empty($parent)) {
    return array(
      $distinction_key => $parent,
    );
  }
  return NULL;
}