You are here

public function Webform::getElementsOriginalDecoded in Webform 8.5

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

Get original elements decoded as an associative array.

Return value

array|bool Elements as an associative array. Returns FALSE if elements YAML is invalid.

Overrides WebformInterface::getElementsOriginalDecoded

1 call to Webform::getElementsOriginalDecoded()
Webform::postSave in src/Entity/Webform.php
Acts on a saved entity before the insert or update hook is invoked.

File

src/Entity/Webform.php, line 1244

Class

Webform
Defines the webform entity.

Namespace

Drupal\webform\Entity

Code

public function getElementsOriginalDecoded() {
  $this->elementsOriginal;
  try {
    $elements = WebformYaml::decode($this->elementsOriginal);
    return is_array($elements) ? $elements : [];
  } catch (\Exception $exception) {
    return FALSE;
  }
}