You are here

public function CpfItem::isEmpty in CPF 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Field/FieldType/CpfItem.php \Drupal\cpf\Plugin\Field\FieldType\CpfItem::isEmpty()

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/CpfItem.php, line 172
Contains \Drupal\cpf\Plugin\Field\FieldType\CpfItem.

Class

CpfItem
Plugin implementation of the 'cpf' field type.

Namespace

Drupal\cpf\Plugin\Field\FieldType

Code

public function isEmpty() {
  $value = $this
    ->get('value')
    ->getValue();
  $value = $this->cpfService
    ->digits($value);
  return empty($value);
}