Updated to Drupal 8.5. Core Media not yet in use.
[yaffs-website] / web / core / modules / user / src / StatusItem.php
diff --git a/web/core/modules/user/src/StatusItem.php b/web/core/modules/user/src/StatusItem.php
new file mode 100644 (file)
index 0000000..76c2117
--- /dev/null
@@ -0,0 +1,25 @@
+<?php
+
+namespace Drupal\user;
+
+use Drupal\Core\Field\FieldDefinitionInterface;
+use Drupal\Core\Field\Plugin\Field\FieldType\BooleanItem;
+
+/**
+ * Defines the 'status' entity field type.
+ *
+ * @todo Consider making this a full field type plugin in
+ *   https://www.drupal.org/project/drupal/issues/2936864.
+ */
+class StatusItem extends BooleanItem {
+
+  /**
+   * {@inheritdoc}
+   */
+  public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
+    // Always generate a sample with an enabled status.
+    $values['value'] = 1;
+    return $values;
+  }
+
+}