src/Forms/Form.php
public function setSessionValidationResult(ValidationResult $result, $combineWithExisting = false)
    {
        // Combine with existing result
        if ($combineWithExisting) {
            $existingResult = $this->getSessionValidationResult();
            if ($existingResult) {
                if ($result) {
                    $existingResult->combineAnd($result);
                } else {
                    $result = $existingResult;
                }
            }
        }

        // Serialise
        $resultData = $result ? serialize($result) : null;
        $this->getSession()->set("FormInfo.{$this->FormName()}.result", $resultData);
        return $this;
    }
public function setSessionValidationResult(ValidationResult $result, $combineWithExisting = false)
    {
        // Combine with existing result
        if ($combineWithExisting) {
            $existingResult = $this->getSessionValidationResult();
            if ($existingResult) {
                if ($result) {
                    $existingResult->combineAnd($result);
                } else {
                    $result = $existingResult;
                }
            }
        }

        // Serialise
        $resultData = $result ? serialize($result) : null;
        $this->getSession()->set("FormInfo.{$this->FormName()}.result", $resultData);
        return $this;
    }
public function setSessionValidationResult ( ValidationResult $ result , $ combineWithExisting = false ) { // Combine with existing result if ( $ combineWithExisting ) { $ existingResult = $ this -> getSessionValidationResult ( ) ; if ( $ existingResult ) { if ( $ result ) { $ existingResult -> combineAnd ( $ result ) ; } else { $ result = $ existingResult ; } } } // Serialise $ resultData = $ result ? serialize ( $ result ) : null ; $ this -> getSession ( ) -> set ( "FormInfo.{$this->FormName()}.result" , $ resultData ) ; return $ this ; }
Sets the ValidationResult in the session to be used with the next view of this form.
@param ValidationResult $result The result to save
@param bool $combineWithExisting If true, then this will be added to the existing result.
@return $this
Sets the ValidationResult in the session to be used with the next view of this form .