You are here

function eck__entity__edit in Entity Construction Kit (ECK) 7

Same name and namespace in other branches
  1. 7.3 eck.entity.inc \eck__entity__edit()
  2. 7.2 eck.entity.inc \eck__entity__edit()

Callback function for an entities edit page

Parameters

$entity_type: (String) entity type

$bundle: (String) Bundle

$id: (int) the Id of the entity to be edited

File

./eck.entity.inc, line 213
All the menus, pages, and functionality related to administering entities.

Code

function eck__entity__edit($entity_type, $bundle, $id) {
  if (is_numeric($id)) {
    $entities = entity_load($entity_type->name, array(
      $id,
    ));
    $entity = $entities[$id];
  }
  global $user;
  $entity->uid = $user->uid;
  $entity->changed = time();
  return drupal_get_form("eck__entity__form", $entity);
}