src/Web/Result.php
public function hasCode($code)
    {
        if ($this->getException() !== null && $this->getException()->getCode() === $code) {
            return true;
        }

        foreach ($this->getErrors() as $message) {
            if ($message['code'] == $code) {
                return true;
            }
        }

        foreach ($this->getWarnings() as $message) {
            if ($message['code'] == $code) {
                return true;
            }
        }

        foreach ($this->getNotices() as $message) {
            if ($message['code'] == $code) {
                return true;
            }
        }

        return false;
    }
public function hasCode($code)
    {
        if ($this->getException() !== null && $this->getException()->getCode() === $code) {
            return true;
        }

        foreach ($this->getErrors() as $message) {
            if ($message['code'] == $code) {
                return true;
            }
        }

        foreach ($this->getWarnings() as $message) {
            if ($message['code'] == $code) {
                return true;
            }
        }

        foreach ($this->getNotices() as $message) {
            if ($message['code'] == $code) {
                return true;
            }
        }

        return false;
    }
public function hasCode ( $ code ) { if ( $ this -> getException ( ) !== null && $ this -> getException ( ) -> getCode ( ) === $ code ) { return true ; } foreach ( $ this -> getErrors ( ) as $ message ) { if ( $ message [ 'code' ] == $ code ) { return true ; } } foreach ( $ this -> getWarnings ( ) as $ message ) { if ( $ message [ 'code' ] == $ code ) { return true ; } } foreach ( $ this -> getNotices ( ) as $ message ) { if ( $ message [ 'code' ] == $ code ) { return true ; } } return false ; }
Returns whether the result contains a given code.

@param int $code

@return bool
True if the result contains a given code, false otherwise.
Returns whether the result contains a given code .