PHP Class PhpOrient\Protocols\Binary\Abstracts\Operation

Inheritance: implements PhpOrient\Protocols\Common\ConfigurableInterface, use trait PhpOrient\Protocols\Common\ConfigurableTrait
Show file Open project: ostico/phporient

Protected Properties

Property Type Description
$_callback Closur\Closure | string Callback function to apply on Async records when they are fetched
$_input_buffer of read stream
$_output_buffer of read stream
$_socket The socket to write to.
$_transport PhpOrient\Protocols\Binary\SocketTransport
$_writeStack array Stack of elements to compile
$opCode The op code.

Public Methods

Method Description
__construct ( PhpOrient\Protocols\Binary\SocketTransport $_transport ) Class constructor
_read_sync ( ) : array | null Read sync command payloads
getResponse ( ) : mixed Get Response from Server
prepare ( ) Build the operation payload
send ( ) Send message to orient server

Protected Methods

Method Description
_checkConditions ( PhpOrient\Protocols\Binary\SocketTransport $transport ) : null | void
_dump_streams ( ) Log of input/output stream
_pushReceived ( $command_id, $payload ) Default callback for received push Notices
_read ( ) : mixed Read the response from the socket.
_readBoolean ( ) : boolean Read a boolean from the socket.
_readByte ( ) : integer Read a byte from the socket.
_readBytes ( ) : string | null Read bytes from the socket.
_readChar ( ) : integer Read a character from the socket.
_readError ( ) : PhpOrient\Exceptions\PhpOrientException Read an error from the remote server and turn it into an exception.
_readHeader ( ) Read the response header.
_readInt ( ) : integer Read an integer from the socket.
_readLong ( ) : integer Read a long from the socket.
_readRecord ( ) : array The format depends if a RID is passed or an entire record with its content.
_readSerialized ( ) : mixed Read a serialized object from the remote server.
_readShort ( ) : integer Read a short from the socket.
_readString ( ) : string | null Read a string from the socket.
_read_prefetch_record ( ) : Record[] Read pre-fetched and async Records
_write ( ) Write the data to the socket.
_writeBoolean ( boolean $value ) Write a boolean to the socket.
_writeByte ( integer $value ) Write a byte to the socket.
_writeBytes ( string $value ) Write bytes to the socket.
_writeChar ( string $value ) Write a character to the socket.
_writeHeader ( ) Write the request header.
_writeInt ( integer $value ) Write an integer to the socket.
_writeLong ( integer $value ) Write a long to the socket.
_writeShort ( integer $value ) Write a short to the socket.
_writeString ( string $value ) Write a string to the socket.

Method Details

__construct() public method

Class constructor
public __construct ( PhpOrient\Protocols\Binary\SocketTransport $_transport )
$_transport PhpOrient\Protocols\Binary\SocketTransport

_checkConditions() protected method

protected _checkConditions ( PhpOrient\Protocols\Binary\SocketTransport $transport ) : null | void
$transport PhpOrient\Protocols\Binary\SocketTransport
return null | void

_dump_streams() protected method

Log of input/output stream
protected _dump_streams ( )

_pushReceived() protected method

Default callback for received push Notices
protected _pushReceived ( $command_id, $payload )
$command_id
$payload

_read() abstract protected method

Read the response from the socket.
abstract protected _read ( ) : mixed
return mixed the response.

_readBoolean() protected method

Read a boolean from the socket.
protected _readBoolean ( ) : boolean
return boolean the boolean read

_readByte() protected method

Read a byte from the socket.
protected _readByte ( ) : integer
return integer the byte read

_readBytes() protected method

Read bytes from the socket.
protected _readBytes ( ) : string | null
return string | null the bytes read, or null if it's empty.

_readChar() protected method

Read a character from the socket.
protected _readChar ( ) : integer
return integer the character read

_readError() protected method

Read an error from the remote server and turn it into an exception.
protected _readError ( ) : PhpOrient\Exceptions\PhpOrientException
return PhpOrient\Exceptions\PhpOrientException the wrapped exception object.

_readHeader() protected method

Read the response header.
protected _readHeader ( )

_readInt() protected method

Read an integer from the socket.
protected _readInt ( ) : integer
return integer the integer read

_readLong() protected method

Read a long from the socket.
protected _readLong ( ) : integer
return integer the integer read

_readRecord() protected method

In case of null record then -2 as short is passed. In case of RID -3 is passes as short and then the RID: (-3:short)(cluster-id:short)(cluster-position:long). In case of record: (0:short)(record-type:byte)(cluster-id:short) (cluster-position:long)(record-version:int)(record-content:bytes)
protected _readRecord ( ) : array
return array

_readSerialized() protected method

Read a serialized object from the remote server.
protected _readSerialized ( ) : mixed
return mixed

_readShort() protected method

Read a short from the socket.
protected _readShort ( ) : integer
return integer the short read

_readString() protected method

Read a string from the socket.
protected _readString ( ) : string | null
return string | null the string read, or null if it's empty.

_read_prefetch_record() protected method

Read pre-fetched and async Records
protected _read_prefetch_record ( ) : Record[]
return PhpOrient\Protocols\Binary\Data\Record[]

_read_sync() public method

Read sync command payloads
public _read_sync ( ) : array | null
return array | null

_write() abstract protected method

Write the data to the socket.
abstract protected _write ( )

_writeBoolean() protected method

Write a boolean to the socket.
protected _writeBoolean ( boolean $value )
$value boolean

_writeByte() protected method

Write a byte to the socket.
protected _writeByte ( integer $value )
$value integer

_writeBytes() protected method

Write bytes to the socket.
protected _writeBytes ( string $value )
$value string

_writeChar() protected method

Write a character to the socket.
protected _writeChar ( string $value )
$value string

_writeHeader() protected method

Write the request header.
protected _writeHeader ( )

_writeInt() protected method

Write an integer to the socket.
protected _writeInt ( integer $value )
$value integer

_writeLong() protected method

Write a long to the socket.
protected _writeLong ( integer $value )
$value integer

_writeShort() protected method

Write a short to the socket.
protected _writeShort ( integer $value )
$value integer

_writeString() protected method

Write a string to the socket.
protected _writeString ( string $value )
$value string

getResponse() public method

Get Response from Server
public getResponse ( ) : mixed
return mixed

prepare() public method

Build the operation payload
public prepare ( )

send() public method

Send message to orient server
public send ( )

Property Details

$_callback protected property

Callback function to apply on Async records when they are fetched
protected Closure,Closur|string $_callback
return Closur\Closure | string

$_input_buffer protected property

of read stream
protected $_input_buffer

$_output_buffer protected property

of read stream
protected $_output_buffer

$_socket protected property

The socket to write to.
protected $_socket

$_transport protected property

protected SocketTransport,PhpOrient\Protocols\Binary $_transport
return PhpOrient\Protocols\Binary\SocketTransport

$_writeStack protected property

Stack of elements to compile
protected array $_writeStack
return array

$opCode protected property

The op code.
protected $opCode