SubformState::getValues

public &SubformState::getValues()

Implements \Drupal\Core\Form\FormStateInterface::getValues()

Overrides FormStateValuesTrait::getValues

File

core/lib/Drupal/Core/Form/SubformState.php, line 99

Class

SubformState
Stores information about the state of a subform.

Namespace

Drupal\Core\Form

Code

public function &getValues() {
  $exists = NULL;
  $values = &NestedArray::getValue(parent::getValues(), $this->getParents('#parents'), $exists);
  if (!$exists) {
    $values = [];
  }
  elseif (!is_array($values)) {
    throw new \UnexpectedValueException('The form state values do not belong to the subform.');
  }

  return $values;
}
doc_Drupal
2016-10-29 09:45:25
Comments
Leave a Comment

Please login to continue.