You are here

public function EventStorage::countDefaultLanguageRevisions in Event 8

Counts the number of revisions in the default language.

Parameters

\Drupal\event\Entity\EventInterface $entity: The Event entity.

Return value

int The number of revisions in the default language.

Overrides EventStorageInterface::countDefaultLanguageRevisions

File

src/EventStorage.php, line 43

Class

EventStorage
Defines the storage handler class for Event entities.

Namespace

Drupal\event

Code

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