You are here

function party_hat_entity_info in Party 7

Same name and namespace in other branches
  1. 8.2 modules/party_hat/party_hat.module \party_hat_entity_info()

Implements hook_entity_info().

File

modules/party_hat/party_hat.module, line 27
party_hat.module Provides an extensible access system for parties.

Code

function party_hat_entity_info() {

  // The hat entity.
  $entity_info['party_hat'] = array(
    'label' => t('Hat'),
    'entity class' => 'PartyHat',
    'controller class' => 'PartyHatController',
    // We define this so entity module provides us with basic Views data, while
    // allowing us to define more of our own.
    // See http://drupal.org/node/1307760.
    'views controller class' => 'EntityDefaultViewsController',
    'base table' => 'party_hat',
    'fieldable' => TRUE,
    'module' => 'party_hat',
    'entity keys' => array(
      'id' => 'hid',
      'label' => 'label',
      'name' => 'name',
    ),
    'exportable' => TRUE,
    'access callback' => 'party_hat_access',
    'uri callback' => 'party_hat_uri',
    'label callback' => 'entity_class_label',
    'admin ui' => array(
      'controller class' => 'PartyHatUIController',
      'path' => 'admin/community/hats',
      'file' => 'party_hat.admin.inc',
    ),
    'bundles' => array(
      'hat' => array(
        'label' => t('Hat'),
        'admin' => array(
          'path' => 'admin/community/hats',
          'access arguments' => array(
            'administer hats',
          ),
        ),
      ),
    ),
    'view modes' => array(
      'full' => array(
        'label' => t('Full Hat'),
        'custom settings' => FALSE,
      ),
    ),
  );
  return $entity_info;
}