You are here

public function WebformInterface::applyVariants in Webform 8.5

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

Apply webform variants based on a webform submission or parameter.

Parameters

\Drupal\webform\WebformSubmissionInterface $webform_submission: A webform submission.

array $variants: An associative array of variant element keys and variant ids.

bool $force: Apply disabled variants. Defaults to FALSE.

Throws

\Exception Throws exception if submission was not created using this webform.

1 method overrides WebformInterface::applyVariants()
Webform::applyVariants in src/Entity/Webform.php
Apply webform variants based on a webform submission or parameter.

File

src/WebformInterface.php, line 1113

Class

WebformInterface
Provides an interface defining a webform entity.

Namespace

Drupal\webform

Code

public function applyVariants(WebformSubmissionInterface $webform_submission = NULL, array $variants = [], $force = FALSE);