public function PasswordItem::isEmpty in Drupal 9
Same name and namespace in other branches
- 8 core/lib/Drupal/Core/Field/Plugin/Field/FieldType/PasswordItem.php \Drupal\Core\Field\Plugin\Field\FieldType\PasswordItem::isEmpty()
Determines whether the data structure is empty.
Return value
bool TRUE if the data structure is empty, FALSE otherwise.
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\FieldTypeCode
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;
}