You are here

function webform_workflow_entity_info in Webform Workflow 7

Implements hook_entity_info().

File

./webform_workflow.module, line 12
A simple workflow module for webforms.

Code

function webform_workflow_entity_info() {
  $entities = array();
  $entities['webform_workflow_state'] = array(
    'label' => t('Webform Workflow State'),
    'controller class' => 'WebformWorkflowStateController',
    'views controller class' => 'EntityDefaultViewsController',
    'uri callback' => 'webform_workflow_state_uri',
    'access callback' => 'webform_workflow_state_access',
    'base table' => 'webform_workflow_state',
    'entity keys' => array(
      'id' => 'wsid',
      'label' => 'label',
    ),
    'view callback' => 'entity_metadata_view_single',
    'static cache' => TRUE,
    'fieldable' => TRUE,
    'module' => 'webform_workflow',
    'metatag' => FALSE,
    'redirect' => FALSE,
    'inline entity form' => array(
      'controller' => 'WebformWorkflowStateInlineEntityFormController',
    ),
    'bundles' => array(
      'webform_workflow_state' => array(
        'label' => t('State'),
        'admin' => array(
          'path' => 'admin/structure/webform-workflow/states',
        ),
      ),
    ),
  );

  // Expose webform submissions as very basic entities purely so that Rules and
  // Views Bulk Operations can be used.
  $entities['webform_workflow_submission'] = array(
    'label' => t('Webform Submission'),
    'controller class' => 'EntityAPIController',
    'base table' => 'webform_submissions',
    'entity keys' => array(
      'id' => 'sid',
      'label' => 'sid',
    ),
    'fieldable' => FALSE,
    'module' => 'webform_workflow',
  );
  return $entities;
}