You are here

public function SubformState::getValues in Drupal 9

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Form/SubformState.php \Drupal\Core\Form\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;
}