You are here

public static function IframeItem::schema in Iframe 8

Same name and namespace in other branches
  1. 8.2 src/Plugin/Field/FieldType/IframeItem.php \Drupal\iframe\Plugin\Field\FieldType\IframeItem::schema()

Implements hook_field_schema().

Overrides FieldItemInterface::schema

File

src/Plugin/Field/FieldType/IframeItem.php, line 83

Class

IframeItem
Plugin implementation of the 'Iframe' field type.

Namespace

Drupal\iframe\Plugin\Field\FieldType

Code

public static function schema(FieldStorageDefinitionInterface $field_definition) {
  return [
    'columns' => [
      'url' => [
        'description' => 'The URL of the iframe.',
        'type' => 'varchar',
        'length' => 2048,
        'not null' => FALSE,
        'sortable' => TRUE,
        'default' => '',
      ],
      'title' => [
        'description' => 'The iframe title text.',
        'type' => 'varchar',
        'length' => 255,
        'not null' => FALSE,
        'sortable' => TRUE,
        'default' => '',
      ],
      'class' => [
        'description' => 'When output, this iframe will have this CSS class attribute. Multiple classes should be separated by spaces.',
        'type' => 'varchar',
        'length' => '255',
        'not null' => FALSE,
        'default' => '',
      ],
      'width' => [
        'description' => 'The iframe width.',
        'type' => 'varchar',
        'length' => 4,
        'not null' => FALSE,
        'default' => '600',
      ],
      'height' => [
        'description' => 'The iframe height.',
        'type' => 'varchar',
        'length' => 4,
        'not null' => FALSE,
        'default' => '800',
      ],
      'frameborder' => [
        'description' => 'Frameborder is the border around the iframe. Most people want it removed, so the default value for frameborder is zero (0), or no border.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ],
      'scrolling' => [
        'description' => 'Scrollbars help the user to reach all iframe content despite the real height of the iframe content. Please disable it only if you know what you are doing.',
        'type' => 'varchar',
        'length' => 4,
        'not null' => TRUE,
        'default' => 'auto',
      ],
      'transparency' => [
        'description' => 'Allow transparency per CSS in the outer iframe tag. You have to set background-color:transparent in your iframe body tag too!',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ],
      'tokensupport' => [
        'description' => 'Are tokens allowed for users to use in title or URL field?',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ],
      'allowfullscreen' => [
        'description' => 'Allow fullscreen for iframe. The iframe can activate fullscreen mode by calling the requestFullscreen() method.',
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ],
    ],
    'indexes' => [
      'url' => [
        'url',
      ],
    ],
  ];
}