You are here

private function UnserializedListField::removeEmpty in Legal 2.0.x

Same name and namespace in other branches
  1. 8 src/Plugin/views/field/UnserializedListField.php \Drupal\legal\Plugin\views\field\UnserializedListField::removeEmpty()

Removes all items without value from the extras array.

Parameters

array $extras: The array of extras.

1 call to UnserializedListField::removeEmpty()
UnserializedListField::render in src/Plugin/views/field/UnserializedListField.php
Renders the field.

File

src/Plugin/views/field/UnserializedListField.php, line 38

Class

UnserializedListField
Field handler to flag the node type.

Namespace

Drupal\legal\Plugin\views\field

Code

private function removeEmpty(array &$extras) {
  foreach ($extras as $key => $value) {
    if ($value == '') {
      unset($extras[$key]);
    }
  }
}