You are here

protected function OptionsLimitWebformHandler::getBooleanTotal in Webform 6.x

Same name and namespace in other branches
  1. 8.5 modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php \Drupal\webform_options_limit\Plugin\WebformHandler\OptionsLimitWebformHandler::getBooleanTotal()

Get boolean submission total for the current webform and source entity.

Return value

int Boolean totals.

2 calls to OptionsLimitWebformHandler::getBooleanTotal()
OptionsLimitWebformHandler::getBooleanLimits in modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php
Get an associative array of boolean limits.
OptionsLimitWebformHandler::validateBooleanElement in modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php
Validate a boolean element with limit(s).

File

modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php, line 1303

Class

OptionsLimitWebformHandler
Webform options and boolean (boolean) limit handler.

Namespace

Drupal\webform_options_limit\Plugin\WebformHandler

Code

protected function getBooleanTotal() {
  $query = $this
    ->getTotalQuery();
  if (!$query) {
    return NULL;
  }
  $query
    ->condition('sd.value', '1');
  return $query
    ->countQuery()
    ->execute()
    ->fetchField();
}