You are here

protected function _entityreference_CrumbsMultiPlugin::_findParentPath in Crumbs, the Breadcrumbs suite 7

2 calls to _entityreference_CrumbsMultiPlugin::_findParentPath()
_entityreference_CrumbsMultiPlugin_node::findParent__node_x in plugins/crumbs.entityreference.inc
Match "node/%" router path
_entityreference_CrumbsMultiPlugin_user::findParent__user_x in plugins/crumbs.entityreference.inc
Match "user/%" router path

File

plugins/crumbs.entityreference.inc, line 42

Class

_entityreference_CrumbsMultiPlugin

Code

protected function _findParentPath($entity) {
  $items = field_get_items($this->entityType, $entity, $this->fieldKey);
  if ($items) {
    $field = field_info_field($this->fieldKey);
    $item = $items[0];
    $target_id = $item['target_id'];
    $target_type = $field['settings']['target_type'];
    $method = '_getPath_' . $target_type;
    if (method_exists($this, $method)) {
      return $this
        ->{$method}($target_id);
    }
  }
}