You are here

protected function WebformSubmissionForm::getWebformSetting in Webform 8.5

Same name and namespace in other branches
  1. 6.x src/WebformSubmissionForm.php \Drupal\webform\WebformSubmissionForm::getWebformSetting()

Get a webform submission's webform setting.

Parameters

string $name: Setting name.

null|mixed $default_value: Default value.

Return value

mixed A webform setting.

21 calls to WebformSubmissionForm::getWebformSetting()
WebformSubmissionForm::actions in src/WebformSubmissionForm.php
Returns an array of supported actions for the current entity form.
WebformSubmissionForm::attachBehaviors in src/WebformSubmissionForm.php
Attach behaviors with libraries to the form.
WebformSubmissionForm::autosave in src/WebformSubmissionForm.php
Webform submission handler to autosave when there are validation errors.
WebformSubmissionForm::buildForm in src/WebformSubmissionForm.php
Form constructor.
WebformSubmissionForm::checkTotalLimit in src/WebformSubmissionForm.php
Check webform submission total limits.

... See full list

File

src/WebformSubmissionForm.php, line 3054

Class

WebformSubmissionForm
Provides a webform to collect and edit submissions.

Namespace

Drupal\webform

Code

protected function getWebformSetting($name, $default_value = NULL) {
  $value = $this
    ->getWebform()
    ->getSetting($name) ?: $this
    ->config('webform.settings')
    ->get('settings.default_' . $name) ?: NULL;
  if ($value !== NULL) {
    return $this->tokenManager
      ->replace($value, $this
      ->getEntity(), [], [], $this->bubbleableMetadata);
  }
  else {
    return $default_value;
  }
}