public function NodeGrantDatabaseStorage::checkAll in Drupal 10
Same name and namespace in other branches
- 8 core/modules/node/src/NodeGrantDatabaseStorage.php \Drupal\node\NodeGrantDatabaseStorage::checkAll()
- 9 core/modules/node/src/NodeGrantDatabaseStorage.php \Drupal\node\NodeGrantDatabaseStorage::checkAll()
File
- core/
modules/ node/ src/ NodeGrantDatabaseStorage.php, line 131
Class
- NodeGrantDatabaseStorage
- Defines a storage handler class that handles the node grants system.
Namespace
Drupal\nodeCode
public function checkAll(AccountInterface $account) {
$query = $this->database
->select('node_access');
$query
->addExpression('COUNT(*)');
$query
->condition('nid', 0)
->condition('grant_view', 1, '>=');
$grants = $this
->buildGrantsQueryCondition(node_access_grants('view', $account));
if (count($grants) > 0) {
$query
->condition($grants);
}
return $query
->execute()
->fetchField();
}