You are here

protected function EntityExtraField::isArrayEmpty in Entity Extra Field 2.0.x

Determine if the array is completely empty.

Parameters

array $array: A single or multidimensional array.

Return value

bool Return TRUE if empty, otherwise FALSE.

1 call to EntityExtraField::isArrayEmpty()
EntityExtraField::getActiveFieldTypeConditions in src/Entity/EntityExtraField.php
Get active field type conditions.

File

src/Entity/EntityExtraField.php, line 471

Class

EntityExtraField
Define entity extra field.

Namespace

Drupal\entity_extra_field\Entity

Code

protected function isArrayEmpty(array $array) : bool {
  foreach (NestedArray::filter($array) as $value) {
    if (!empty($value)) {
      return FALSE;
    }
    if (is_array($value)) {
      $this
        ->isArrayEmpty($value);
    }
  }
  return TRUE;
}