function EntityStorageBase::hasData

Same name and namespace in other branches
  1. 9 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::hasData()
  2. 8.9.x core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::hasData()
  3. 10 core/lib/Drupal/Core/Entity/EntityStorageBase.php \Drupal\Core\Entity\EntityStorageBase::hasData()

Overrides EntityStorageInterface::hasData

3 methods override EntityStorageBase::hasData()
ConfigEntityStorage::hasData in core/lib/Drupal/Core/Config/Entity/ConfigEntityStorage.php
Determines if the storage contains any data.
ContentEntityNullStorage::hasData in core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php
Determines if the storage contains any data.
KeyValueEntityStorage::hasData in core/lib/Drupal/Core/Entity/KeyValueStore/KeyValueEntityStorage.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.