You are here

function eck__entity__uri in Entity Construction Kit (ECK) 7.3

Same name and namespace in other branches
  1. 7 eck.module \eck__entity__uri()
  2. 7.2 eck.module \eck__entity__uri()

Entity URI callback.

Parameters

object $entity: an object as returned by entity_load().

1 string reference to 'eck__entity__uri'
eck__entity_type__info in ./eck.entity_type.inc
Generate the entity info for a specific entity.

File

./eck.module, line 191

Code

function eck__entity__uri($entity) {
  $ids = entity_extract_ids($entity
    ->entityType(), $entity);
  module_load_include('inc', 'eck', 'eck.entity');
  $crud_info = get_bundle_crud_info($entity
    ->entityType(), $entity
    ->bundle());
  $view_path = str_replace('%eckentity', $ids[0], $crud_info['view']['path']);
  return array(
    'path' => $view_path,
  );
}