public function addValues(array $fieldValues)
    {
        foreach ($fieldValues as $fieldName => $values) {
            $values = Arr::cast($values);
            if (null === ($field = $this->getField($fieldName))) {
                $message = "unknown field";
                $len = count($values);
                if ($len !== 1) {
                    $message .= " (encountered $len values)";
                }
                $error = new Error($message);
                $error->setName($fieldName);
                $this->addError($error);
            }
            else {
                foreach ($values as $index => $value) {
                    $field->addValue($value, $index);
                }   
            }
        }
    }
public function addValues(array $fieldValues)
    {
        foreach ($fieldValues as $fieldName => $values) {
            $values = Arr::cast($values);
            if (null === ($field = $this->getField($fieldName))) {
                $message = "unknown field";
                $len = count($values);
                if ($len !== 1) {
                    $message .= " (encountered $len values)";
                }
                $error = new Error($message);
                $error->setName($fieldName);
                $this->addError($error);
            }
            else {
                foreach ($values as $index => $value) {
                    $field->addValue($value, $index);
                }   
            }
        }
    }
public function addValues ( array $ fieldValues ) { foreach ( $ fieldValues as $ fieldName => $ values ) { $ values = Arr :: cast ( $ values ) ; if ( null === ( $ field = $ this -> getField ( $ fieldName ) ) ) { $ message = "unknown field" ; $ len = count ( $ values ) ; if ( $ len !== 1 ) { $ message .= " (encountered $len values)" ; } $ error = new Error ( $ message ) ; $ error -> setName ( $ fieldName ) ; $ this -> addError ( $ error ) ; } else { foreach ( $ values as $ index => $ value ) { $ field -> addValue ( $ value , $ index ) ; } } } }
Add values to the fields in the collection

@param array<string,mixed> $fieldValues
Add values to the fields in the collection