function SubformState::getValues

Same name in other branches
  1. 9 core/lib/Drupal/Core/Form/SubformState.php \Drupal\Core\Form\SubformState::getValues()
  2. 10 core/lib/Drupal/Core/Form/SubformState.php \Drupal\Core\Form\SubformState::getValues()
  3. 11.x core/lib/Drupal/Core/Form/SubformState.php \Drupal\Core\Form\SubformState::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;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.