public function get()
    {

        $class = null;

        // decide the most accurate exception we've got for this state and throw that
        if( $this->state ) {

            for( $i = 5; $i > 0; $i-- ) {
               $exceptionQueue[] = sprintf(
                "State%s",
                substr( $this->state, 0, $i )
               );
            }

            while( !$class and $_class = array_shift( $exceptionQueue ) ) {
                $file = __DIR__ . "/Exception/States/{$_class}.php";
                if( file_exists($file) ) {
                    $class = $_class;
                }
            }

        }

        // decide on class
        if( !$class ) {
            $class = 'Bond\Pg\Exception\QueryException';
        } else {
            $class = 'Bond\Pg\Exception\States\\'. $class;
        }

        //die( $class );

        return new $class(
            $this->sqlError,
            $this->state,
            self::getStateMessage($this->state),
            $this->sql
        );

    }
public function get()
    {

        $class = null;

        // decide the most accurate exception we've got for this state and throw that
        if( $this->state ) {

            for( $i = 5; $i > 0; $i-- ) {
               $exceptionQueue[] = sprintf(
                "State%s",
                substr( $this->state, 0, $i )
               );
            }

            while( !$class and $_class = array_shift( $exceptionQueue ) ) {
                $file = __DIR__ . "/Exception/States/{$_class}.php";
                if( file_exists($file) ) {
                    $class = $_class;
                }
            }

        }

        // decide on class
        if( !$class ) {
            $class = 'Bond\Pg\Exception\QueryException';
        } else {
            $class = 'Bond\Pg\Exception\States\\'. $class;
        }

        //die( $class );

        return new $class(
            $this->sqlError,
            $this->state,
            self::getStateMessage($this->state),
            $this->sql
        );

    }
public function get ( ) { $ class = null ; // decide the most accurate exception we've got for this state and throw that if ( $ this -> state ) { for ( $ i = 5 ; $ i > 0 ; $ i -- ) { $ exceptionQueue [ ] = sprintf ( "State%s" , substr ( $ this -> state , 0 , $ i ) ) ; } while ( ! $ class and $ _class = array_shift ( $ exceptionQueue ) ) { $ file = __DIR__ . "/Exception/States/{$_class}.php" ; if ( file_exists ( $ file ) ) { $ class = $ _class ; } } } // decide on class if ( ! $ class ) { $ class = 'Bond\Pg\Exception\QueryException' ; } else { $ class = 'Bond\Pg\Exception\States\\' . $ class ; } //die( $class ); return new $ class ( $ this -> sqlError , $ this -> state , self :: getStateMessage ( $ this -> state ) , $ this -> sql ) ; }
Get the actual exception
@return Bond\Pg\Exception\QueryException
Get the actual exception