public function setAppendFormFieldsFunction(callable $function)
    {
        $validator = $this->getCallableValidatorAppendFormFields();
        $validator->setCallableFunction($function);

        if ($validator->isValid() === false) {
            throw $validator->getException();
        }

        $this->appendFormFieldsFunction = $function;

        return $this;
    }