You are here

public function EasyEmailStorage::countDefaultLanguageRevisions in Easy Email 8

Same name and namespace in other branches
  1. 2.0.x src/EasyEmailStorage.php \Drupal\easy_email\EasyEmailStorage::countDefaultLanguageRevisions()

Counts the number of revisions in the default language.

Parameters

\Drupal\easy_email\Entity\EasyEmailInterface $entity: The Email entity.

Return value

int The number of revisions in the default language.

Overrides EasyEmailStorageInterface::countDefaultLanguageRevisions

File

src/EasyEmailStorage.php, line 114

Class

EasyEmailStorage
Defines the storage handler class for Email entities.

Namespace

Drupal\easy_email

Code

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