You are here

fraction_entity_test.module in Fraction 7

File

tests/fraction_entity_test/fraction_entity_test.module
View source
<?php

/**
 * Implements hook_entity_info().
 */
function fraction_entity_test_entity_info() {
  $info = array();
  $info['fraction_entity_test'] = array(
    'module' => 'fraction_entity_test',
    'label' => t('Fraction Entity Test'),
    'entity class' => 'FractionEntityTest',
    'controller class' => 'FractionEntityTestController',
    'metadata controller class' => 'FractionEntityTestMetadataController',
    'base table' => 'fraction_entity_test',
    'fieldable' => TRUE,
    'entity keys' => array(
      'id' => 'id',
      'bundle' => 'type',
    ),
    'bundle keys' => array(
      'bundle' => 'name',
    ),
    'bundles' => array(
      'fraction_entity_test_bundle' => array(
        'label' => t('Fraction Entity Test Bundle'),
        'admin' => array(
          'path' => 'admin/config/fraction_entity_test/types/%fraction_entity_test_type',
          'real path' => 'admin/config/fraction_entity_test/types/fraction_entity_test_bundle',
          'bundle argument' => 5,
        ),
      ),
    ),
    'view modes' => array(
      'full' => array(
        'label' => t('Full content'),
        'custom settings' => FALSE,
      ),
    ),
  );
  $info['fraction_entity_test_type'] = array(
    'module' => 'fraction_entity_test',
    'label' => t('Fraction Entity Test Type'),
    'entity class' => 'FractionEntityTestType',
    'controller class' => 'EntityAPIControllerExportable',
    'base table' => 'fraction_entity_test_type',
    'entity keys' => array(
      'id' => 'id',
      'name' => 'name',
      'label' => 'label',
    ),
    'fieldable' => FALSE,
    'bundle of' => 'fraction_entity_test',
    'exportable' => TRUE,
    'admin ui' => array(
      'path' => 'admin/config/fraction_entity_test/types',
      'controller class' => 'FractionEntityTestTypeUIController',
    ),
  );
  return $info;
}

Functions