You are here

protected function WebformSubmissionForm::isWebformEntityReferenceFromSourceEntity in Webform 8.5

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

Is the current webform an entity reference from the source entity.

Return value

bool TRUE is the current webform an entity reference from the source entity.

File

src/WebformSubmissionForm.php, line 2944

Class

WebformSubmissionForm
Provides a webform to collect and edit submissions.

Namespace

Drupal\webform

Code

protected function isWebformEntityReferenceFromSourceEntity() {
  if (!$this->sourceEntity) {
    return FALSE;
  }
  $webform = $this->webformEntityReferenceManager
    ->getWebform($this->sourceEntity);
  if (!$webform) {
    return FALSE;
  }
  return $webform
    ->id() === $this
    ->getWebform()
    ->id() ? TRUE : FALSE;
}