PHP Класс Shanty_Mongo_Connection_Group

Автор: Coen Hyde
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$_masters
$_slaves

Открытые методы

Метод Описание
__construct ( array $connectionOptions = null )
addConnections ( array $connectionOptions ) Add multiple connections at once using arrays of options
addMaster ( Shanty_Mongo_Connection $connection, integer $weight = 1 ) Add a connection to a master server
addSlave ( Shanty_Mongo_Connection $connection, $weight = 1 ) Add a connection to a slaver server
formatConnectionString ( array $connectionOptions = [] ) Format a connection string
formatHostString ( array $hostOptions = [] ) : string Format a host string
getMasters ( ) : Shanty_Mongo_Connection_Stack Get all master connections
getReadConnection ( ) : Shanty_Mongo_Connection Get a read connection
getSlaves ( ) : Shanty_Mongo_Connection_Stack Get all slave connections
getWriteConnection ( ) : Shanty_Mongo_Connection Get a write connection

Описание методов

__construct() публичный Метод

public __construct ( array $connectionOptions = null )
$connectionOptions array

addConnections() публичный Метод

Add multiple connections at once using arrays of options
public addConnections ( array $connectionOptions )
$connectionOptions array

addMaster() публичный Метод

Add a connection to a master server
public addMaster ( Shanty_Mongo_Connection $connection, integer $weight = 1 )
$connection Shanty_Mongo_Connection
$weight integer

addSlave() публичный Метод

Add a connection to a slaver server
public addSlave ( Shanty_Mongo_Connection $connection, $weight = 1 )
$connection Shanty_Mongo_Connection
$weight

formatConnectionString() публичный Метод

Format a connection string
public formatConnectionString ( array $connectionOptions = [] )
$connectionOptions array

formatHostString() публичный Метод

Format a host string
public formatHostString ( array $hostOptions = [] ) : string
$hostOptions array
Результат string

getMasters() публичный Метод

Get all master connections
public getMasters ( ) : Shanty_Mongo_Connection_Stack
Результат Shanty_Mongo_Connection_Stack

getReadConnection() публичный Метод

Get a read connection
public getReadConnection ( ) : Shanty_Mongo_Connection
Результат Shanty_Mongo_Connection

getSlaves() публичный Метод

Get all slave connections
public getSlaves ( ) : Shanty_Mongo_Connection_Stack
Результат Shanty_Mongo_Connection_Stack

getWriteConnection() публичный Метод

Get a write connection
public getWriteConnection ( ) : Shanty_Mongo_Connection
Результат Shanty_Mongo_Connection

Описание свойств

$_masters защищенное свойство

protected $_masters

$_slaves защищенное свойство

protected $_slaves