You are here

function gdpr_tasks_entity_info in General Data Protection Regulation 7

Implements hook_entity_info().

File

modules/gdpr_tasks/gdpr_tasks.module, line 22
Module file for the GDPR Tasks module.

Code

function gdpr_tasks_entity_info() {
  $entities = array();
  $entities['gdpr_task'] = array(
    'label' => t('Task'),
    'base table' => 'gdpr_task',
    'entity class' => 'GDPRTask',
    'controller class' => 'GDPRTaskController',
    'module' => 'gdpr_tasks',
    'admin ui' => array(
      'path' => 'admin/structure/gdpr-tasks',
      'file' => 'gdpr_tasks.admin.inc',
      'menu wildcard' => '%gdpr_task',
      'controller class' => 'GDPRTaskUIController',
    ),
    'access callback' => 'gdpr_task_access',
    'entity keys' => array(
      'id' => 'id',
      'bundle' => 'type',
      'label' => 'id',
      'language' => 'language',
      'status' => 'none',
    ),
    'bundle keys' => array(
      'bundle' => 'type',
    ),
    'bundles' => array(
      'gdpr_remove' => array(
        'label' => 'Removal Request',
        'admin' => array(
          'path' => 'admin/structure/gdpr-tasks/manage/%',
          'real path' => 'admin/structure/gdpr-tasks/manage/gdpr_remove',
          'bundle argument' => 4,
          'access arguments' => array(
            'administer task entities',
          ),
        ),
      ),
      'gdpr_sar' => array(
        'label' => 'SARs Request',
        'admin' => array(
          'path' => 'admin/structure/gdpr-tasks/manage/%',
          'real path' => 'admin/structure/gdpr-tasks/manage/gdpr_sar',
          'bundle argument' => 4,
          'access arguments' => array(
            'administer task entities',
          ),
        ),
      ),
    ),
    'fieldable' => TRUE,
  );
  $entities['gdpr_task_type'] = array(
    'label' => t('Task type'),
    'plural label' => t('Task types'),
    'description' => t('Task types for GDPR Tasks.'),
    'entity class' => 'GDPRTaskType',
    'controller class' => 'EntityAPIControllerExportable',
    'base table' => 'gdpr_task_type',
    'fieldable' => FALSE,
    'bundle of' => 'gdpr_task',
    'exportable' => TRUE,
    'entity keys' => array(
      'id' => 'id',
      'name' => 'type',
      'label' => 'label',
    ),
    'access callback' => 'gdpr_task_type_access',
    'module' => 'gdpr_tasks',
    'admin ui' => array(
      'path' => 'admin/structure/gdpr-tasks',
      'file' => 'gdpr_tasks.admin.inc',
      'controller class' => 'EntityDefaultUIController',
    ),
  );
  return $entities;
}