You are here

public function SitewideAlertStorage::countDefaultLanguageRevisions in Sitewide Alert 8

Counts the number of revisions in the default language.

Parameters

\Drupal\sitewide_alert\Entity\SitewideAlertInterface $entity: The Sitewide Alert entity.

Return value

int The number of revisions in the default language.

Overrides SitewideAlertStorageInterface::countDefaultLanguageRevisions

File

src/SitewideAlertStorage.php, line 43

Class

SitewideAlertStorage
Defines the storage handler class for Sitewide Alert entities.

Namespace

Drupal\sitewide_alert

Code

public function countDefaultLanguageRevisions(SitewideAlertInterface $entity) {
  return $this->database
    ->query('SELECT COUNT(*) FROM {sitewide_alert_field_revision} WHERE id = :id AND default_langcode = 1', [
    ':id' => $entity
      ->id(),
  ])
    ->fetchField();
}