You are here

protected function WebformSubmissionLimitBlock::getLimit in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/Block/WebformSubmissionLimitBlock.php \Drupal\webform\Plugin\Block\WebformSubmissionLimitBlock::getLimit()

Get submission limit.

Return value

int|bool The submission limit or FALSE if not submission limit is defined.

3 calls to WebformSubmissionLimitBlock::getLimit()
WebformSubmissionLimitBlock::blockAccess in src/Plugin/Block/WebformSubmissionLimitBlock.php
Indicates whether the block should be shown.
WebformSubmissionLimitBlock::build in src/Plugin/Block/WebformSubmissionLimitBlock.php
Builds and returns the renderable array for this block plugin.
WebformSubmissionLimitBlock::replaceTokens in src/Plugin/Block/WebformSubmissionLimitBlock.php
Replace tokens in text.

File

src/Plugin/Block/WebformSubmissionLimitBlock.php, line 353

Class

WebformSubmissionLimitBlock
Provides a 'Webform submission limit' block.

Namespace

Drupal\webform\Plugin\Block

Code

protected function getLimit() {
  $name = $this->configuration['source_entity'] ? 'entity_' : '';
  $name .= $this->configuration['type'] === 'user' ? 'limit_user' : 'limit_total';
  return $this
    ->getWebform()
    ->getSetting($name) ?: FALSE;
}