function PasswordItem::isEmpty

Overrides StringItemBase::isEmpty

File

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

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.