You are here

public function PetStorage::countDefaultLanguageRevisions in Previewable email templates 8.3

Counts the number of revisions in the default language.

Parameters

\Drupal\pet\Entity\PetInterface $entity: The Pet entity.

Return value

int The number of revisions in the default language.

Overrides PetStorageInterface::countDefaultLanguageRevisions

File

src/PetStorage.php, line 43

Class

PetStorage
Defines the storage handler class for Pet entities.

Namespace

Drupal\pet

Code

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