function node_registration_entity_info in Node registration 7
Implements hook_entity_info().
File
- includes/
node_registration.entity.inc, line 11 - Entity hooks and callbacks for registrations.
Code
function node_registration_entity_info() {
$module_path = _node_registration_type_to_uri('node_registration');
$bundles = array();
// Node types + specific nodes.
foreach (_node_registration_bundles() as $type => $name) {
$bundles[$type] = array(
'label' => $name . ' registration',
'name' => $name,
'type' => $type,
'admin' => array(
'path' => 'admin/structure/' . $module_path . '/manage/%node_registration_type',
'real path' => 'admin/structure/' . $module_path . '/manage/' . _node_registration_type_to_uri($type),
'bundle argument' => 4,
'access arguments' => array(
'administer node registration',
),
),
);
}
return array(
'node_registration' => array(
'module' => 'node_registration',
'label' => t('Node registration'),
'controller class' => 'NodeRegistrationController',
'entity class' => 'NodeRegistrationEntityClass',
'base table' => 'node_registration',
'fieldable' => TRUE,
'redirect' => FALSE,
'entity keys' => array(
'id' => 'registration_id',
'bundle' => 'type',
),
'bundle keys' => array(
'bundle' => 'type',
),
'bundles' => $bundles,
'view modes' => array(
'full' => array(
'label' => t('Full Registration'),
'custom settings' => FALSE,
),
'simple' => array(
'label' => t('Simple Registration'),
'custom settings' => FALSE,
),
),
'uri callback' => 'node_registration_uri',
'label callback' => 'node_registration_label',
'token type' => 'node-registration',
'access callback' => 'node_registration_access_proxy',
),
);
}