You are here

public function Webform::setElements in Webform 8.5

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

Sets elements (YAML) value.

Parameters

array $elements: An renderable array of elements.

Return value

$this

Overrides WebformInterface::setElements

3 calls to Webform::setElements()
Webform::deleteElement in src/Entity/Webform.php
Remove an element.
Webform::initElementsTranslation in src/Entity/Webform.php
Initialize elements translation.
Webform::setElementProperties in src/Entity/Webform.php
Set element properties.

File

src/Entity/Webform.php, line 1440

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

public function setElements(array $elements) {
  $this->elements = WebformYaml::encode($elements);
  $this
    ->resetElements();
  return $this;
}