You are here

public function HomeboxLayoutStorage::countDefaultLanguageRevisions in Homebox 8

Counts the number of revisions in the default language.

Parameters

\Drupal\homebox\Entity\HomeboxLayoutInterface $entity: The Homebox Layout entity.

Return value

int The number of revisions in the default language.

Overrides HomeboxLayoutStorageInterface::countDefaultLanguageRevisions

File

src/HomeboxLayoutStorage.php, line 43

Class

HomeboxLayoutStorage
Defines the storage handler class for Homebox Layout entities.

Namespace

Drupal\homebox

Code

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