You are here

function social_content_instagram_create_fields in Social Content 7.2

Same name and namespace in other branches
  1. 7 modules/instagram/social_content_instagram.fields.inc \social_content_instagram_create_fields()

Returns a structured array defining the fields created by this content type.

Return value

array An associative array specifying the fields we wish to add to our new node type.

1 call to social_content_instagram_create_fields()
social_content_instagram_install in modules/instagram/social_content_instagram.install
Implements hook_install().

File

modules/instagram/social_content_instagram.fields.inc, line 16
Fields for the `Instagram` content type.

Code

function social_content_instagram_create_fields() {
  return array(
    'field_instagram_picture' => array(
      'translatable' => '0',
      'entity_types' => array(),
      'settings' => array(
        'uri_scheme' => 'public',
        'default_image' => 0,
      ),
      'storage' => array(
        'type' => 'field_sql_storage',
        'settings' => array(),
        'module' => 'field_sql_storage',
        'active' => '1',
        'details' => array(
          'sql' => array(
            'FIELD_LOAD_CURRENT' => array(
              'field_data_field_instagram_picture' => array(
                'fid' => 'field_instagram_picture_fid',
                'alt' => 'field_instagram_picture_alt',
                'title' => 'field_instagram_picture_title',
                'width' => 'field_instagram_picture_width',
                'height' => 'field_instagram_picture_height',
              ),
            ),
            'FIELD_LOAD_REVISION' => array(
              'field_revision_field_instagram_picture' => array(
                'fid' => 'field_instagram_picture_fid',
                'alt' => 'field_instagram_picture_alt',
                'title' => 'field_instagram_picture_title',
                'width' => 'field_instagram_picture_width',
                'height' => 'field_instagram_picture_height',
              ),
            ),
          ),
        ),
      ),
      'foreign keys' => array(
        'fid' => array(
          'table' => 'file_managed',
          'columns' => array(
            'fid' => 'fid',
          ),
        ),
      ),
      'indexes' => array(
        'fid' => array(
          'fid',
        ),
      ),
      'field_name' => 'field_instagram_picture',
      'type' => 'image',
      'module' => 'image',
      'active' => '1',
      'locked' => '0',
      'cardinality' => '1',
      'deleted' => '0',
      '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' => 512,
          'not null' => FALSE,
        ),
        'title' => array(
          'description' => "Image title text, for the image's 'title' attribute.",
          'type' => 'varchar',
          'length' => 1024,
          '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,
        ),
      ),
      'bundles' => array(
        'node' => array(
          'instagram',
        ),
      ),
    ),
    'field_instagram_link' => array(
      'translatable' => '0',
      'entity_types' => array(),
      'settings' => array(
        'attributes' => array(
          'target' => 'default',
          'class' => '',
          'rel' => '',
        ),
        'url' => 0,
        'title' => 'optional',
        'title_value' => '',
        'title_maxlength' => 128,
        'enable_tokens' => 1,
        'display' => array(
          'url_cutoff' => 80,
        ),
      ),
      'storage' => array(
        'type' => 'field_sql_storage',
        'settings' => array(),
        'module' => 'field_sql_storage',
        'active' => '1',
        'details' => array(
          'sql' => array(
            'FIELD_LOAD_CURRENT' => array(
              'field_data_field_instagram_link' => array(
                'url' => 'field_instagram_link_url',
                'title' => 'field_instagram_link_title',
                'attributes' => 'field_instagram_link_attributes',
              ),
            ),
            'FIELD_LOAD_REVISION' => array(
              'field_revision_field_instagram_link' => array(
                'url' => 'field_instagram_link_url',
                'title' => 'field_instagram_link_title',
                'attributes' => 'field_instagram_link_attributes',
              ),
            ),
          ),
        ),
      ),
      'foreign keys' => array(),
      'indexes' => array(),
      'field_name' => 'field_instagram_link',
      'type' => 'link_field',
      'module' => 'link',
      'active' => '1',
      'locked' => '0',
      'cardinality' => '1',
      'deleted' => '0',
      'columns' => array(
        'url' => array(
          'type' => 'varchar',
          'length' => 2048,
          'not null' => FALSE,
          'sortable' => TRUE,
        ),
        'title' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => FALSE,
          'sortable' => TRUE,
        ),
        'attributes' => array(
          'type' => 'text',
          'size' => 'medium',
          'not null' => FALSE,
        ),
      ),
      'bundles' => array(
        'node' => array(
          'instagram',
        ),
      ),
    ),
    'field_instagram_external_id' => array(
      'translatable' => '0',
      'entity_types' => array(),
      'settings' => array(
        'max_length' => '255',
      ),
      'storage' => array(
        'type' => 'field_sql_storage',
        'settings' => array(),
        'module' => 'field_sql_storage',
        'active' => '1',
        'details' => array(
          'sql' => array(
            'FIELD_LOAD_CURRENT' => array(
              'field_data_field_instagram_external_id' => array(
                'value' => 'field_instagram_external_id_value',
                'format' => 'field_instagram_external_id_format',
              ),
            ),
            'FIELD_LOAD_REVISION' => array(
              'field_revision_field_instagram_external_id' => array(
                'value' => 'field_instagram_external_id_value',
                'format' => 'field_instagram_external_id_format',
              ),
            ),
          ),
        ),
      ),
      'foreign keys' => array(
        'format' => array(
          'table' => 'filter_format',
          'columns' => array(
            'format' => 'format',
          ),
        ),
      ),
      'indexes' => array(
        'format' => array(
          'format',
        ),
      ),
      'field_name' => 'field_instagram_external_id',
      'type' => 'text',
      'module' => 'text',
      'active' => '1',
      'locked' => '0',
      'cardinality' => '1',
      'deleted' => '0',
      'columns' => array(
        'value' => array(
          'type' => 'varchar',
          'length' => '255',
          'not null' => FALSE,
        ),
        'format' => array(
          'type' => 'varchar',
          'length' => 255,
          'not null' => FALSE,
        ),
      ),
      'bundles' => array(
        'node' => array(
          'instagram',
        ),
      ),
    ),
  );
}