Skip to content

PhpOrient PhpOrient

Domenico Lupinetti edited this page Jan 24, 2015 · 5 revisions

PhpOrient\PhpOrient

Class PhpOrient

Constants

DATABASE_TYPE_DOCUMENT

    const DATABASE_TYPE_DOCUMENT = \PhpOrient\Protocols\Common\Constants::DATABASE_TYPE_DOCUMENT

DATABASE_TYPE_GRAPH

    const DATABASE_TYPE_GRAPH = \PhpOrient\Protocols\Common\Constants::DATABASE_TYPE_GRAPH

CLUSTER_TYPE_PHYSICAL

    const CLUSTER_TYPE_PHYSICAL = \PhpOrient\Protocols\Common\Constants::CLUSTER_TYPE_PHYSICAL

CLUSTER_TYPE_MEMORY

    const CLUSTER_TYPE_MEMORY = \PhpOrient\Protocols\Common\Constants::CLUSTER_TYPE_MEMORY

SERIALIZATION_DOCUMENT2CSV

    const SERIALIZATION_DOCUMENT2CSV = \PhpOrient\Protocols\Common\Constants::SERIALIZATION_DOCUMENT2CSV

SERIALIZATION_SERIAL_BIN

    const SERIALIZATION_SERIAL_BIN = \PhpOrient\Protocols\Common\Constants::SERIALIZATION_SERIAL_BIN

STORAGE_TYPE_LOCAL

    const STORAGE_TYPE_LOCAL = \PhpOrient\Protocols\Common\Constants::STORAGE_TYPE_LOCAL

STORAGE_TYPE_PLOCAL

    const STORAGE_TYPE_PLOCAL = \PhpOrient\Protocols\Common\Constants::STORAGE_TYPE_PLOCAL

STORAGE_TYPE_MEMORY

    const STORAGE_TYPE_MEMORY = \PhpOrient\Protocols\Common\Constants::STORAGE_TYPE_MEMORY

Properties

$hostname

    public string $hostname

The server host.

  • Visibility: public

$port

    public string $port

The port for the server.

  • Visibility: public

$username

    public string $username

The username for the server.

  • Visibility: public

$password

    public string $password

The password for the server.

  • Visibility: public

$_transport

    protected \PhpOrient\Protocols\Common\TransportInterface $_transport

The transport to use for the connection to the server.

  • Visibility: protected

Methods

__construct

    mixed PhpOrient\PhpOrient::__construct(string $hostname, string $port, string|boolean $token)
Class Constructor
  • Visibility: public
Arguments
  • $hostname string

    The server host.

  • $port string

    The server port.

  • $token string|boolean

    An old connection Token to reuse, or a flag to set a new token instance initialization

setSessionToken

    \PhpOrient\PhpOrient PhpOrient\PhpOrient::setSessionToken(string|boolean $token)
Set the session token to re-use old

connection credentials or a flag to set a new token instance initialization

  • Visibility: public
Arguments
  • $token string|boolean

getSessionToken

    string PhpOrient\PhpOrient::getSessionToken()
Get the token for this connection
  • Visibility: public

setTransport

    \PhpOrient\PhpOrient PhpOrient\PhpOrient::setTransport(\PhpOrient\Protocols\Common\TransportInterface $transport)
Sets the transport
  • Visibility: public
Arguments

getTransport

    \PhpOrient\Protocols\Binary\SocketTransport PhpOrient\PhpOrient::getTransport()
Gets the transport
  • Visibility: public

getTransactionStatement

    \PhpOrient\Protocols\Binary\Transaction\TxCommit PhpOrient\PhpOrient::getTransactionStatement()
Start a new Transaction
  • Visibility: public

createTransport

    \PhpOrient\Protocols\Binary\SocketTransport PhpOrient\PhpOrient::createTransport(\PhpOrient\Protocols\Common\TransportInterface|null $transport)
Create a transport instance.
  • Visibility: protected
Arguments

execute

    mixed PhpOrient\PhpOrient::execute(string $operation, array $params)
Execute the given operation.
  • Visibility: public
Arguments
  • $operation string

    The name of the operation to prepare.

  • $params array

    The parameters for the operation.

connect

    mixed PhpOrient\PhpOrient::connect(string $username, string $password, string $serializationType)
This is the first operation requested by the client when

it needs to work with the server instance.
It returns the session id of the client.

  • Visibility: public
Arguments
  • $username string
  • $password string
  • $serializationType string

shutDown

    mixed PhpOrient\PhpOrient::shutDown(string $username, string $password)
Send a command to shutdown the server

Requires "shutdown" permission to be set in orientdb-server-config.xml file

  • Visibility: public
Arguments
  • $username string
  • $password string

command

    mixed PhpOrient\PhpOrient::command(string $query)
Execute a not idempotent SQL command
  • Visibility: public
Arguments
  • $query string

query

    mixed PhpOrient\PhpOrient::query(string $query, integer $limit, string $fetchPlan)
Execute an idempotent SQL command ( Select usually )
  • Visibility: public
Arguments
  • $query string
  • $limit integer
  • $fetchPlan string

queryAsync

    mixed PhpOrient\PhpOrient::queryAsync(string $query, Array $params)
Execute an idempotent SQL command in Async mode( Select usually )

A callback function is needed

  • Visibility: public
Arguments
  • $query string
  • $params Array

sqlBatch

    mixed PhpOrient\PhpOrient::sqlBatch(string $param)
Execute an SQL Batch Script command
  • Visibility: public
Arguments
  • $param string

recordUpdate

    \PhpOrient\Protocols\Binary\Operations\RecordUpdate|\PhpOrient\Protocols\Binary\Data\Record PhpOrient\PhpOrient::recordUpdate(\PhpOrient\Protocols\Binary\Data\Record $record)
Update a Record
  • Visibility: public
Arguments

recordCreate

    \PhpOrient\Protocols\Binary\Operations\RecordCreate|\PhpOrient\Protocols\Binary\Data\Record PhpOrient\PhpOrient::recordCreate(\PhpOrient\Protocols\Binary\Data\Record $record)
Create a record
  • Visibility: public
Arguments

recordDelete

    \PhpOrient\Protocols\Binary\Operations\RecordDelete|boolean PhpOrient\PhpOrient::recordDelete(\PhpOrient\Protocols\Binary\Data\ID $rid)
Delete a Record
  • Visibility: public
Arguments

recordLoad

    \PhpOrient\RecordLoad/Record PhpOrient\PhpOrient::recordLoad(\PhpOrient\Protocols\Binary\Data\ID $rid, array $params)
Load a Record
  • Visibility: public
Arguments

dbSize

    integer|string PhpOrient\PhpOrient::dbSize()
Get the size of a Database
  • Visibility: public

dbReload

    \PhpOrient\Protocols\Common\ClusterMap PhpOrient\PhpOrient::dbReload()
Reload the structure of a Database
  • Visibility: public

dbRelease

    true PhpOrient\PhpOrient::dbRelease(string $db_name, string $storage_type)
Release the structure of a Database
  • Visibility: public
Arguments
  • $db_name string
  • $storage_type string

dbOpen

    \PhpOrient\Protocols\Common\ClusterMap PhpOrient\PhpOrient::dbOpen(string $database, string $username, string $password, array $params)
Open a Database and perform a connection

if it is not established before

  • Visibility: public
Arguments
  • $database string
  • $username string
  • $password string
  • $params array

    { 'serializationType' => PhpOrient::SERIALIZATION_DOCUMENT2CSV, 'databaseType' => PhpOrient::DATABASE_TYPE_GRAPH }

dbList

    array PhpOrient\PhpOrient::dbList()
List all databases inside OrientDB instance
  • Visibility: public

dbFreeze

    boolean PhpOrient\PhpOrient::dbFreeze(string $db_name, string $storage_type)
Freeze a database ( need Release to unlock )

Flushes all cached content to the disk storage and allows to perform only read commands

  • Visibility: public
Arguments
  • $db_name string
  • $storage_type string

dbExists

    boolean PhpOrient\PhpOrient::dbExists($database, string $database_type)
Check if a database exists
  • Visibility: public
Arguments
  • $database mixed
  • $database_type string

dbDrop

    true PhpOrient\PhpOrient::dbDrop($database, string $storage_type)
Drop an existent database
  • Visibility: public
Arguments
  • $database mixed
  • $storage_type string

dbCreate

    boolean PhpOrient\PhpOrient::dbCreate(string $database, string $storage_type, string $database_type)
Create a new Database
  • Visibility: public
Arguments
  • $database string
  • $storage_type string
  • $database_type string

dbCountRecords

    integer|string PhpOrient\PhpOrient::dbCountRecords()
Create a new Database
  • Visibility: public

dbClose

    integer PhpOrient\PhpOrient::dbClose()
Close a database a drop the connection
  • Visibility: public

dataClusterDrop

    boolean PhpOrient\PhpOrient::dataClusterDrop(integer $cluster_id)
Drop a data cluster
  • Visibility: public
Arguments
  • $cluster_id integer

dataClusterDataRange

    array<mixed,integer>|array<mixed,string> PhpOrient\PhpOrient::dataClusterDataRange(integer $cluster_id)
Returns the range of record ids for a cluster.
  • Visibility: public
Arguments
  • $cluster_id integer

dataClusterCount

    integer|string PhpOrient\PhpOrient::dataClusterCount(array $cluster_ids)
Returns the number of records in one or more clusters.
  • Visibility: public
Arguments
  • $cluster_ids array

dataClusterAdd

    integer PhpOrient\PhpOrient::dataClusterAdd($cluster_name, string $cluster_type)
Add a new data cluster
  • Visibility: public
Arguments
  • $cluster_name mixed
  • $cluster_type string

configure

    \PhpOrient\Protocols\Common\ConfigurableInterface PhpOrient\Protocols\Common\ConfigurableInterface::configure(array $options)
Configure the object.
Arguments
  • $options array

    The options for the object.

fromConfig

    static PhpOrient\PhpOrient::fromConfig(array $options)
Return a new class instance configured from the given options.
  • Visibility: public
  • This method is static.
Arguments
  • $options array

    The options for the newly created class instance.

Clone this wiki locally