You are here

public function Webform::getVariant in Webform 8.5

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

Returns a specific webform variant.

Parameters

string $variant_id: The webform variant ID.

Return value

\Drupal\webform\Plugin\WebformVariantInterface The webform variant object.

Overrides WebformInterface::getVariant

1 call to Webform::getVariant()
Webform::applyVariant in src/Entity/Webform.php
Apply webform variant.

File

src/Entity/Webform.php, line 2831

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

public function getVariant($variant_id) {
  return $this
    ->getVariants()
    ->get($variant_id);
}