You are here

public function FieldStorageConfig::hasData in Drupal 8

Same name and namespace in other branches
  1. 9 core/modules/field/src/Entity/FieldStorageConfig.php \Drupal\field\Entity\FieldStorageConfig::hasData()

Determines whether a field has any data.

Return value

bool TRUE if the field has data for any entity; FALSE otherwise.

File

core/modules/field/src/Entity/FieldStorageConfig.php, line 711

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

public function hasData() {
  return \Drupal::entityTypeManager()
    ->getStorage($this->entity_type)
    ->countFieldData($this, TRUE);
}