Version 1
[yaffs-website] / web / core / modules / text / src / Plugin / Field / FieldType / TextLongItem.php
diff --git a/web/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php b/web/core/modules/text/src/Plugin/Field/FieldType/TextLongItem.php
new file mode 100644 (file)
index 0000000..15e4eb6
--- /dev/null
@@ -0,0 +1,42 @@
+<?php
+
+namespace Drupal\text\Plugin\Field\FieldType;
+
+use Drupal\Core\Field\FieldStorageDefinitionInterface;
+
+/**
+ * Plugin implementation of the 'text_long' field type.
+ *
+ * @FieldType(
+ *   id = "text_long",
+ *   label = @Translation("Text (formatted, long)"),
+ *   description = @Translation("This field stores a long text with a text format."),
+ *   category = @Translation("Text"),
+ *   default_widget = "text_textarea",
+ *   default_formatter = "text_default"
+ * )
+ */
+class TextLongItem extends TextItemBase {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function schema(FieldStorageDefinitionInterface $field_definition) {
+    return [
+      'columns' => [
+        'value' => [
+          'type' => 'text',
+          'size' => 'big',
+        ],
+        'format' => [
+          'type' => 'varchar_ascii',
+          'length' => 255,
+        ],
+      ],
+      'indexes' => [
+        'format' => ['format'],
+      ],
+    ];
+  }
+
+}