You are here

dynamic_entity_reference.install in Dynamic Entity Reference 7

Same filename and directory in other branches
  1. 8.2 dynamic_entity_reference.install

Contains install and update hooks for the module.

File

dynamic_entity_reference.install
View source
<?php

/**
 * @file
 * Contains install and update hooks for the module.
 */

/**
 * Implements hook_field_schema().
 */
function dynamic_entity_reference_field_schema($field) {
  if ($field['type'] == 'dynamic_entity_reference') {
    $columns = array(
      'target_id' => array(
        'description' => 'The ID of the target entity.',
        'type' => 'varchar',
        'length' => '255',
      ),
      'target_type' => array(
        'description' => 'The Entity Type ID of the target entity.',
        'type' => 'varchar',
        'length' => 64,
      ),
    );
    $schema = array(
      'columns' => $columns,
      'indexes' => array(
        'target_id' => array(
          'target_id',
        ),
      ),
    );
    return $schema;
  }
}

Functions