class StatusItem

Same name and namespace in other branches
  1. 11.x core/modules/user/src/StatusItem.php \Drupal\user\StatusItem
  2. 10 core/modules/user/src/StatusItem.php \Drupal\user\StatusItem
  3. 8.9.x core/modules/user/src/StatusItem.php \Drupal\user\StatusItem

Defines the 'status' entity field type.

@todo Consider making this a full field type plugin in https://www.drupal.org/project/drupal/issues/2936864.

Hierarchy

Expanded class hierarchy of StatusItem

3 files declare their use of StatusItem
Term.php in core/modules/taxonomy/src/Entity/Term.php
User.php in core/modules/user/src/Entity/User.php
XmlEntityNormalizationQuirksTrait.php in core/modules/rest/tests/src/Functional/EntityResource/XmlEntityNormalizationQuirksTrait.php

File

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

Namespace

Drupal\user
View source
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;
  }

}

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