function StatusItem::generateSampleValue

Same name and namespace in other branches
  1. 9 core/modules/user/src/StatusItem.php \Drupal\user\StatusItem::generateSampleValue()
  2. 10 core/modules/user/src/StatusItem.php \Drupal\user\StatusItem::generateSampleValue()
  3. 11.x core/modules/user/src/StatusItem.php \Drupal\user\StatusItem::generateSampleValue()

Overrides BooleanItem::generateSampleValue

File

core/modules/user/src/StatusItem.php, line 19

Class

StatusItem
Defines the 'status' entity field type.

Namespace

Drupal\user

Code

public static function generateSampleValue(FieldDefinitionInterface $field_definition) {
    // Always generate a sample with an enabled status.
    $values['value'] = 1;
    return $values;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.