You are here

public function YamlForm::setElementProperties in YAML Form 8

Set element properties.

Parameters

string $key: The element's key.

array $properties: An associative array of properties.

string $parent_key: (optional) The element's parent key. Only used for new elements.

Return value

$this

Overrides YamlFormInterface::setElementProperties

File

src/Entity/YamlForm.php, line 943

Class

YamlForm
Defines the form entity.

Namespace

Drupal\yamlform\Entity

Code

public function setElementProperties($key, array $properties, $parent_key = '') {
  $elements = $this
    ->getElementsDecoded();

  // If element is was not added to elements, add it as the last element.
  if (!$this
    ->setElementPropertiesRecursive($elements, $key, $properties, $parent_key)) {
    $elements[$key] = $properties;
  }
  $this
    ->setElements($elements);
  return $this;
}