You are here

public function WebformElementManagerInterface::getElementInstance in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElementManagerInterface.php \Drupal\webform\Plugin\WebformElementManagerInterface::getElementInstance()

Get a webform element plugin instance for an element.

Parameters

array $element: An associative array containing an element with a #type property.

\Drupal\webform\WebformInterface|\Drupal\webform\WebformSubmissionInterface $entity: A webform or webform submission entity.

Return value

\Drupal\webform\Plugin\WebformElementInterface A webform element plugin instance

Throws

\Exception Throw exception if entity type is not a webform or webform submission.

1 method overrides WebformElementManagerInterface::getElementInstance()
WebformElementManager::getElementInstance in src/Plugin/WebformElementManager.php
Get a webform element plugin instance for an element.

File

src/Plugin/WebformElementManagerInterface.php, line 127

Class

WebformElementManagerInterface
Collects available webform elements.

Namespace

Drupal\webform\Plugin

Code

public function getElementInstance(array $element, EntityInterface $entity = NULL);