public function data()
    {

        if( isset( $this->filePath ) ) {

            return file_get_contents( $this->filePath );

        } elseif( $this->oid ) {

            $pg = $this->oid->pg;
            $pg->query( new Query( 'BEGIN' ) );

            $handle = pg_lo_open( $pg->resource->get(), $this->oid->oid, 'r' );

            $result = '';
            while( ( $data = pg_lo_read( $handle ) ) ){
                $result .= $data;
            }

            pg_lo_close( $handle );

            $pg->query( new Query( 'COMMIT' ) );

            return $result;

        }

        throw \LogicException("Shouldn't ever get tripped");

    }
public function data()
    {

        if( isset( $this->filePath ) ) {

            return file_get_contents( $this->filePath );

        } elseif( $this->oid ) {

            $pg = $this->oid->pg;
            $pg->query( new Query( 'BEGIN' ) );

            $handle = pg_lo_open( $pg->resource->get(), $this->oid->oid, 'r' );

            $result = '';
            while( ( $data = pg_lo_read( $handle ) ) ){
                $result .= $data;
            }

            pg_lo_close( $handle );

            $pg->query( new Query( 'COMMIT' ) );

            return $result;

        }

        throw \LogicException("Shouldn't ever get tripped");

    }
public function data ( ) { if ( isset ( $ this -> filePath ) ) { return file_get_contents ( $ this -> filePath ) ; } elseif ( $ this -> oid ) { $ pg = $ this -> oid -> pg ; $ pg -> query ( new Query ( 'BEGIN' ) ) ; $ handle = pg_lo_open ( $ pg -> resource -> get ( ) , $ this -> oid -> oid , 'r' ) ; $ result = '' ; while ( ( $ data = pg_lo_read ( $ handle ) ) ) { $ result .= $ data ; } pg_lo_close ( $ handle ) ; $ pg -> query ( new Query ( 'COMMIT' ) ) ; return $ result ; } throw \ LogicException ( "Shouldn't ever get tripped" ) ; }
Get the data stored in the large object resource.
@param void
@return mixed
Get the data stored in the large object resource .