You are here

function flexiform_webform_entity_info in Flexiform 7

Implements hook_entity_info().

File

flexiform_webform/flexiform_webform.module, line 10
Module provides simple webform functionality.

Code

function flexiform_webform_entity_info() {
  $info = array();

  // The entity that holds information about the entity types
  $info['flexiform_webform'] = array(
    'label' => t('Flexiform Webform'),
    'entity class' => 'FlexiformWebform',
    'controller class' => 'EntityAPIControllerExportable',
    'base table' => 'flexiform_webform',
    'fieldable' => FALSE,
    'bundle of' => 'flexiform_webform_submission',
    'exportable' => TRUE,
    'entity keys' => array(
      'id' => 'id',
      'name' => 'webform',
      'label' => 'label',
    ),
    'access callback' => 'flexiform_access',
    'module' => 'flexiform_webform',
    // Enable the entity API's admin UI.
    'admin ui' => array(
      'path' => 'admin/structure/flexiform_webforms',
      'file' => 'flexiform_webform.admin.inc',
      'controller class' => 'FlexiformWebformUIController',
    ),
  );
  $info['flexiform_webform_submission'] = array(
    'label' => t('Flexiform Webform Submission'),
    // The entity class and controller class extend the classes provided by the
    // Entity API
    'entity class' => 'FlexiformWebformSubmission',
    'controller class' => 'FlexiformWebformSubmissionController',
    'fc handler class' => 'FlexiformFCHandler',
    'base table' => 'flexiform_webform_submission',
    'fieldable' => TRUE,
    'entity keys' => array(
      'id' => 'id',
      'bundle' => 'webform',
    ),
    // Bundles are defined by the flexiforms below
    'bundles' => array(),
    // Bundle keys tell the FieldAPI how to extract information from the bundle objects
    'bundle keys' => array(
      'bundle' => 'webform',
    ),
    'label callback' => 'entity_class_label',
    'uri callback' => 'entity_class_uri',
    'access callback' => 'flexiform_webform_submission_access',
    'module' => 'flexiform_webform',
    'admin ui' => array(
      'path' => 'admin/content/flexiform_webform_submissions',
      'file' => 'flexiform_submission.admin.inc',
      'controller class' => 'FlexiformWebformSubmissionUIController',
      'menu wildcard' => '%flexiform_webform_submission',
    ),
    'view modes' => array(
      'full' => array(
        'label' => 'Full Display',
        'custom settings' => FALSE,
      ),
      'summary' => array(
        'label' => 'Summary',
        'custom settings' => TRUE,
      ),
    ),
  );
  return $info;
}