You are here

public function Webform::hasVariant in Webform 6.x

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

Determine if a specific webform variant exists.

Parameters

string $variant_id: The webform variant ID.

Return value

bool TRUE if a specific webform variant exists.

Overrides WebformInterface::hasVariant

File

src/Entity/Webform.php, line 2825

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

public function hasVariant($variant_id) {
  return $this
    ->getVariants()
    ->has($variant_id);
}