You are here

public function ScheduleStorage::countDefaultLanguageRevisions in Business Rules 8

Same name and namespace in other branches
  1. 2.x src/ScheduleStorage.php \Drupal\business_rules\ScheduleStorage::countDefaultLanguageRevisions()

Counts the number of revisions in the default language.

Parameters

\Drupal\business_rules\Entity\ScheduleInterface $entity: The Schedule entity.

Return value

int The number of revisions in the default language.

Overrides ScheduleStorageInterface::countDefaultLanguageRevisions

File

src/ScheduleStorage.php, line 43

Class

ScheduleStorage
Defines the storage handler class for Schedule entities.

Namespace

Drupal\business_rules

Code

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