You are here

public function FlaggingCollectionStorage::countDefaultLanguageRevisions in Flag Lists 4.0.x

Same name and namespace in other branches
  1. 8 src/FlaggingCollectionStorage.php \Drupal\flag_lists\FlaggingCollectionStorage::countDefaultLanguageRevisions()

Counts the number of revisions in the default language.

Parameters

\Drupal\flag_lists\Entity\FlaggingCollectionInterface $entity: The Flagging collection entity.

Return value

int The number of revisions in the default language.

Overrides FlaggingCollectionStorageInterface::countDefaultLanguageRevisions

File

src/FlaggingCollectionStorage.php, line 43

Class

FlaggingCollectionStorage
Defines the storage handler class for Flagging collection entities.

Namespace

Drupal\flag_lists

Code

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