You are here

function linkimagefield_field_schema in Link Image Field 7

Implements hook_field_schema().

File

./linkimagefield.install, line 14
linkimagefield install and update code. Defines the field schema.

Code

function linkimagefield_field_schema($field) {
  return array(
    'columns' => array(
      'fid' => array(
        'description' => 'The {file_managed}.fid being referenced in this field.',
        'type' => 'int',
        'not null' => FALSE,
        'unsigned' => TRUE,
      ),
      'alt' => array(
        'description' => "Alternative image text, for the image's 'alt' attribute.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'longdesc' => array(
        'description' => "A link to a page with a long description of the image, for the image's 'londesc' attribute.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'title' => array(
        'description' => "Image title text, for the image's 'title' attribute.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'url' => array(
        'description' => "The URL used for the image link.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'target' => array(
        'description' => "The target type of the image link.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'class' => array(
        'description' => "For adding a class attribute to the anchor.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'rel' => array(
        'description' => "A relation tag for bots or lightboxes.",
        'type' => 'varchar',
        'length' => 128,
        'not null' => FALSE,
      ),
      'width' => array(
        'description' => 'The width of the image in pixels.',
        'type' => 'int',
        'unsigned' => TRUE,
      ),
      'height' => array(
        'description' => 'The height of the image in pixels.',
        'type' => 'int',
        'unsigned' => TRUE,
      ),
    ),
    'indexes' => array(
      'fid' => array(
        'fid',
      ),
    ),
    'foreign keys' => array(
      'fid' => array(
        'table' => 'file_managed',
        'columns' => array(
          'fid' => 'fid',
        ),
      ),
    ),
  );
}