function PasswordItem::isEmpty

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::isEmpty()
  2. 8.9.x core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php \Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem::isEmpty()
  3. 10 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php \Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem::isEmpty()

Overrides StringItemBase::isEmpty

File

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

Class

PasswordItem
Defines the 'password' entity field type.

Namespace

Drupal\Core\Field\Plugin\Field\FieldType

Code

public function isEmpty() {
    // We cannot use the parent implementation from StringItem as it does not
    // consider the additional 'existing' property that PasswordItem contains.
    $value = $this->get('value')
        ->getValue();
    $existing = $this->get('existing')
        ->getValue();
    return $value === NULL && $existing === NULL;
}

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