protected function Webform::getContextWebform in Webform 8.5
Same name and namespace in other branches
- 6.x src/Plugin/Condition/Webform.php \Drupal\webform\Plugin\Condition\Webform::getContextWebform()
Gets the webform for a defined context.
Return value
null|\Drupal\webform\WebformInterface The current context's webform.
1 call to Webform::getContextWebform()
- Webform::evaluate in src/
Plugin/ Condition/ Webform.php - Evaluates the condition and returns TRUE or FALSE accordingly.
File
- src/
Plugin/ Condition/ Webform.php, line 182
Class
- Webform
- Provides a 'Webform' condition.
Namespace
Drupal\webform\Plugin\ConditionCode
protected function getContextWebform() {
if ($webform_submission = $this
->getContextValue('webform_submission')) {
return $webform_submission
->getWebform();
}
if ($webform = $this
->getContextValue('webform')) {
return $webform;
}
if ($node = $this
->getContextValue('node')) {
if ($webform_target = $this->webformEntityReferenceManager
->getWebform($node)) {
return $webform_target;
}
}
return NULL;
}