FieldStorageConfig::hasData

public 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 699

Class

FieldStorageConfig
Defines the Field storage configuration entity.

Namespace

Drupal\field\Entity

Code

1
2
3
public function hasData() {
  return \Drupal::entityManager()->getStorage($this->entity_type)->countFieldData($this, TRUE);
}
doc_Drupal
2025-01-10 15:47:30
Comments
Leave a Comment

Please login to continue.