Mercurial > hg > isophonics-drupal-site
comparison core/modules/user/src/StatusItem.php @ 14:1fec387a4317
Update Drupal core to 8.5.2 via Composer
author | Chris Cannam |
---|---|
date | Mon, 23 Apr 2018 09:46:53 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
13:5fb285c0d0e3 | 14:1fec387a4317 |
---|---|
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 } |