Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / modules / user / src / StatusItem.php
1 <?php
2
3 namespace Drupal\user;
4
5 use Drupal\Core\Field\FieldDefinitionInterface;
6 use Drupal\Core\Field\Plugin\Field\FieldType\BooleanItem;
7
8 /**
9  * Defines the 'status' entity field type.
10  *
11  * @todo Consider making this a full field type plugin in
12  *   https://www.drupal.org/project/drupal/issues/2936864.
13  */
14 class StatusItem extends BooleanItem {
15
16   /**
17    * {@inheritdoc}
18    */
19   public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
20     // Always generate a sample with an enabled status.
21     $values['value'] = 1;
22     return $values;
23   }
24
25 }