You are here

public function OptionsLimitWebformHandler::getSourceEntity 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::getSourceEntity()

Get the webform source entity.

Return value

\Drupal\Core\Entity\EntityInterface|null A source entity.

Overrides WebformOptionsLimitHandlerInterface::getSourceEntity

1 call to OptionsLimitWebformHandler::getSourceEntity()
OptionsLimitWebformHandler::getTotalQuery in modules/webform_options_limit/src/Plugin/WebformHandler/OptionsLimitWebformHandler.php
Get base query for options and boolean limit totals.

File

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

Class

OptionsLimitWebformHandler
Webform options and boolean (boolean) limit handler.

Namespace

Drupal\webform_options_limit\Plugin\WebformHandler

Code

public function getSourceEntity() {
  if ($this->sourceEntity) {
    return $this->sourceEntity;
  }
  elseif ($this
    ->getWebformSubmission()) {
    return $this
      ->getWebformSubmission()
      ->getSourceEntity();
  }
  else {
    return NULL;
  }
}