You are here

public function Dimension::isEmpty in Dimension 2.1.x

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldType/Dimension.php \Drupal\dimension\Plugin\Field\FieldType\Dimension::isEmpty()
  2. 2.0.x src/Plugin/Field/FieldType/Dimension.php \Drupal\dimension\Plugin\Field\FieldType\Dimension::isEmpty()

Determines whether the data structure is empty.

Return value

bool TRUE if the data structure is empty, FALSE otherwise.

Overrides NumericItemBase::isEmpty

File

src/Plugin/Field/FieldType/Dimension.php, line 272

Class

Dimension

Namespace

Drupal\dimension\Plugin\Field\FieldType

Code

public function isEmpty() : bool {

  /** @noinspection StaticInvocationViaThisInspection */
  foreach ($this
    ->fields() as $key => $label) {
    if (empty($this->{$key}) && (string) $this->{$key} !== '0') {
      return TRUE;
    }
  }
  return FALSE;
}