You are here

public function CountryStateType::isEmpty in Country, State and City 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/CountryStateType.php, line 124

Class

CountryStateType
Plugin implementation of the 'country_state_type' field type.

Namespace

Drupal\country_state_city\Plugin\Field\FieldType

Code

public function isEmpty() {
  $country = empty($this
    ->get('country')
    ->getValue());
  $state = empty($this
    ->get('state')
    ->getValue());
  return $country || $state;
}