You are here

public function DimensionsItem::isEmpty in Physical Fields 8

Determines whether the data structure is empty.

Return value

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

Overrides Map::isEmpty

File

src/Plugin/Field/FieldType/DimensionsItem.php, line 98

Class

DimensionsItem
Plugin implementation of the 'physical_dimensions' field type.

Namespace

Drupal\physical\Plugin\Field\FieldType

Code

public function isEmpty() {

  // The field is empty if the unit is empty or all numbers are empty.
  if (empty($this->unit)) {
    return TRUE;
  }
  if ($this
    ->checkEmpty($this->length) && $this
    ->checkEmpty($this->width) && $this
    ->checkEmpty($this->height)) {
    return TRUE;
  }
  return FALSE;
}