function EntityStorageBase::hasData

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::hasData()
  2. 9 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::hasData()
  3. 8.9.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::hasData()
1 method overrides EntityStorageBase::hasData()
ConfigEntityStorage::hasData in core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
Determines if the storage contains any data.

File

core/lib/Drupal/Core/Entity/EntityStorageBase.php, line 614

Class

EntityStorageBase
A base entity storage class.

Namespace

Drupal\Core\Entity

Code

public function hasData() {
  return (bool) $this->getQuery()
    ->accessCheck(FALSE)
    ->range(0, 1)
    ->execute();
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.