You are here

public function ContentEntityStorageBase::hasData in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php \Drupal\Core\Entity\ContentEntityStorageBase::hasData()

Determines if the storage contains any data.

Return value

bool TRUE if the storage contains data, FALSE if not.

Overrides DynamicallyFieldableEntityStorageInterface::hasData

1 method overrides ContentEntityStorageBase::hasData()
ContentEntityNullStorage::hasData in core/lib/Drupal/Core/Entity/ContentEntityNullStorage.php
Determines if the storage contains any data.

File

core/lib/Drupal/Core/Entity/ContentEntityStorageBase.php, line 73
Contains \Drupal\Core\Entity\ContentEntityStorageBase.

Class

ContentEntityStorageBase
Base class for content entity storage handlers.

Namespace

Drupal\Core\Entity

Code

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