public function SimpleMegaMenuStorage::countDefaultLanguageRevisions in Simple Mega Menu 8
Same name and namespace in other branches
- 2.0.x src/SimpleMegaMenuStorage.php \Drupal\simple_megamenu\SimpleMegaMenuStorage::countDefaultLanguageRevisions()
Counts the number of revisions in the default language.
Parameters
\Drupal\simple_megamenu\Entity\SimpleMegaMenuInterface $entity: The Simple mega menu entity.
Return value
int The number of revisions in the default language.
Overrides SimpleMegaMenuStorageInterface::countDefaultLanguageRevisions
File
- src/
SimpleMegaMenuStorage.php, line 43
Class
- SimpleMegaMenuStorage
- Defines the storage handler class for Simple mega menu entities.
Namespace
Drupal\simple_megamenuCode
public function countDefaultLanguageRevisions(SimpleMegaMenuInterface $entity) {
return $this->database
->query('SELECT COUNT(*) FROM {simple_mega_menu_field_revision} WHERE id = :id AND default_langcode = 1', [
':id' => $entity
->id(),
])
->fetchField();
}