You are here

public function Webform::updateWebformHandler in Webform 6.x

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

Update a webform handler for this webform.

Parameters

\Drupal\webform\Plugin\WebformHandlerInterface $handler: The webform handler object.

Return value

$this

Overrides WebformInterface::updateWebformHandler

File

src/Entity/Webform.php, line 2659

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

public function updateWebformHandler(WebformHandlerInterface $handler) {
  $handler
    ->setWebform($this);
  $handler_id = $handler
    ->getHandlerId();
  $configuration = $handler
    ->getConfiguration();
  $this
    ->getHandlers()
    ->setInstanceConfiguration($handler_id, $configuration);
  $this
    ->save();
  $this
    ->resetHandlers();
  $handler
    ->updateHandler();
  return $this;
}