You are here

protected function OptionsLimitWebformHandler::getBooleanLimits in Webform 8.5

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

Get an associative array of boolean limits.

Return value

array An associative array of boolean limits keyed by boolean key and includes the boolean's limit, total, remaining, and status.

3 calls to OptionsLimitWebformHandler::getBooleanLimits()
OptionsLimitWebformHandler::alterElement in modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php
Alter webform element.
OptionsLimitWebformHandler::buildSummaryTable in modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php
Build summary table.
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 1213

Class

OptionsLimitWebformHandler
Webform options and boolean (boolean) limit handler.

Namespace

Drupal\webform_options_limit\Plugin\WebformHandler

Code

protected function getBooleanLimits() {
  $element = $this
    ->getElement();
  $key = $element['#webform_key'];
  $label = $element['#title'];
  $limit = $this->configuration['limit'];
  $total = $this
    ->getBooleanTotal();
  return [
    $key => $this
      ->getLimitInformation($label, $limit, $total),
  ];
}