function FieldItemList::filterEmptyItems
Same name in other branches
- 9 core/lib/Drupal/Core/Field/FieldItemList.php \Drupal\Core\Field\FieldItemList::filterEmptyItems()
- 8.9.x core/lib/Drupal/Core/Field/FieldItemList.php \Drupal\Core\Field\FieldItemList::filterEmptyItems()
- 10 core/lib/Drupal/Core/Field/FieldItemList.php \Drupal\Core\Field\FieldItemList::filterEmptyItems()
Overrides FieldItemListInterface::filterEmptyItems
2 calls to FieldItemList::filterEmptyItems()
- FieldItemList::applyDefaultValue in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Applies the default value.
- FieldItemList::preSave in core/
lib/ Drupal/ Core/ Field/ FieldItemList.php - Defines custom presave behavior for field values.
File
-
core/
lib/ Drupal/ Core/ Field/ FieldItemList.php, line 91
Class
- FieldItemList
- Represents an entity field; that is, a list of field item objects.
Namespace
Drupal\Core\FieldCode
public function filterEmptyItems() {
$this->filter(function ($item) {
return !$item->isEmpty();
});
return $this;
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.