You are here

protected function Wizard::filterParameters in Flexiform 8

Filters the parameters to remove any without a valid type.

Return value

$this

1 call to Wizard::filterParameters()
Wizard::preSave in contrib/wizard/src/Entity/Wizard.php
Acts on an entity before the presave hook is invoked.

File

contrib/wizard/src/Entity/Wizard.php, line 310

Class

Wizard
Defines a flexiform wizard entity class.

Namespace

Drupal\flexiform_wizard\Entity

Code

protected function filterParameters() {
  $names = $this
    ->getParameterNames();
  foreach ($this
    ->get('parameters') as $name => $parameter) {

    // Remove parameters without any type, or which are no longer valid.
    if (empty($parameter['type']) || !in_array($name, $names)) {
      $this
        ->removeParameter($name);
    }
  }
  return $this;
}