protected function WebformNodeReferencesListController::getTotal in Webform 6.x
Same name and namespace in other branches
- 8.5 modules/webform_node/src/Controller/WebformNodeReferencesListController.php \Drupal\webform_node\Controller\WebformNodeReferencesListController::getTotal()
Get the total number of references.
Return value
int The total number of references.
1 call to WebformNodeReferencesListController::getTotal()
- WebformNodeReferencesListController::buildInfo in modules/
webform_node/ src/ Controller/ WebformNodeReferencesListController.php - Build information summary.
File
- modules/
webform_node/ src/ Controller/ WebformNodeReferencesListController.php, line 443
Class
- WebformNodeReferencesListController
- Defines a controller for webform node references.
Namespace
Drupal\webform_node\ControllerCode
protected function getTotal() {
$query = $this
->getStorage()
->getQuery()
->sort($this->entityType
->getKey('id'));
// Add field names.
$or = $query
->orConditionGroup();
foreach ($this->fieldNames as $field_name) {
$or
->condition($field_name . '.target_id', $this->webform
->id());
}
$query
->condition($or);
return count($query
->execute());
}