src/Web/Result.php
public function mergeMessages(Result $other, $errorsAsWarnings = false)
    {
        if ($this->getException() === null && $other->getException() !== null) {
            $this->setException($other->getException());
        }
        if ($errorsAsWarnings) {
            $this->addWarnings($other->getErrors());
        } else {
            $this->addErrors($other->getErrors());
        }
        return $this->addWarnings($other->getWarnings())->addNotices($other->getNotices());
    }
public function mergeMessages(Result $other, $errorsAsWarnings = false)
    {
        if ($this->getException() === null && $other->getException() !== null) {
            $this->setException($other->getException());
        }
        if ($errorsAsWarnings) {
            $this->addWarnings($other->getErrors());
        } else {
            $this->addErrors($other->getErrors());
        }
        return $this->addWarnings($other->getWarnings())->addNotices($other->getNotices());
    }
public function mergeMessages ( Result $ other , $ errorsAsWarnings = false ) { if ( $ this -> getException ( ) === null && $ other -> getException ( ) !== null ) { $ this -> setException ( $ other -> getException ( ) ) ; } if ( $ errorsAsWarnings ) { $ this -> addWarnings ( $ other -> getErrors ( ) ) ; } else { $ this -> addErrors ( $ other -> getErrors ( ) ) ; } return $ this -> addWarnings ( $ other -> getWarnings ( ) ) -> addNotices ( $ other -> getNotices ( ) ) ; }
Merges sets of exception, error and warning messages of 2 results.

This allows to inform the user about errors and warnings that occurred
during additional API calls, e.g. querying VAT rates or deleteing old
entries.

@param \Siel\Acumulus\Web\Result $other
The other result to add the messages from.
@param bool $errorsAsWarnings
Whether errors should be merged as errors or as mere warnings because
the main result is not really influenced by these errors.

@return $this
Merges sets of exception error and warning messages of 2 results .