function PasswordItem::propertyDefinitions

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php \Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem::propertyDefinitions()
  2. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php \Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem::propertyDefinitions()
  3. 11.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php \Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem::propertyDefinitions()

Overrides StringItemBase::propertyDefinitions

File

core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php, line 25

Class

PasswordItem
Defines the 'password' entity field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public static function propertyDefinitions(FieldStorageDefinitionInterface $field_definition) {
    $properties['value'] = DataDefinition::create('string')->setLabel(new TranslatableMarkup('The hashed password'))
        ->setSetting('case_sensitive', TRUE);
    $properties['existing'] = DataDefinition::create('string')->setLabel(new TranslatableMarkup('Existing password'));
    $properties['pre_hashed'] = DataDefinition::create('boolean')->setLabel(new TranslatableMarkup('Determines if a password needs hashing'));
    return $properties;
}

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