1 user.module user_entity_info()

Implements hook_entity_info().

File

core/modules/user/user.module, line 120
Enables the user registration and login system.

Code

function user_entity_info() {
  $entity_info = array(
    'user' => array(
      'label' => t('User account'),
      'bundle label' => t('Type'),
      'controller class' => 'UserStorageController',
      'base table' => 'users',
      'fieldable' => TRUE,
      'redirect support' => TRUE,
      'entity class' => 'User',
      'entity keys' => array(
        'id' => 'uid',
      ),
      'bundles' => array(
        'user' => array(
          'label' => t('User account'),
          'admin' => array(
            'path' => 'admin/config/people/manage',
            'access arguments' => array('administer account settings'),
          ),
        ),
      ),
      'view modes' => array(
        'full' => array(
          'label' => t('User account'),
          'custom settings' => FALSE,
        ),
        'token' => array(
          'label' => t('Tokens'),
          'custom settings' => FALSE,
        ),
      ),
    ),
  );

  // If the cache table has been created, then enable entity caching on nodes.
  if (db_table_exists('cache_entity_user')) {
    $entity_info['user']['entity cache'] = TRUE;
    $entity_info['user']['field cache'] = FALSE;
  }

  return $entity_info;
}