PHP Класс Shanty_Mongo

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

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

Свойство Тип Описание
$_connectionGroups
$_initialised
$_requirementCreators
$_requirements
$_validOperations

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

Метод Описание
addConnections ( array $options ) Add connections Shanty Mongo
addMaster ( Shanty_Mongo_Connection $connection, integer $weight = 1, $connectionGroup = 'default' ) Add a connection to a master server
addSlave ( Shanty_Mongo_Connection $connection, $weight = 1, $connectionGroup = 'default' ) Add a connection to a slaver server
createRequirement ( $name, $options = null ) : mixed Create a requirement
getConnectionGroup ( string $name ) : Shanty_Mongo_Connection_Group Get a connection group. If it doesn't already exist, create it
getConnectionGroups ( ) : array Get a list of all connection groups
getReadConnection ( string $connectionGroupName = 'default' ) : Shanty_Mongo_Connection Get a read connection
getWriteConnection ( string $connectionGroupName = 'default' ) : Shanty_Mongo_Connection Get a write connection
hasConnectionGroup ( string $name ) Determine if a connection group exists
init ( ) Initialise Shanty_Mongo. In particular all the requirements.
isValidOperation ( string $operation ) Deterimine if an operation is valid
makeClean ( ) Return Shanty_Mongo to pre-init status
removeConnectionGroups ( ) Remove all connection groups
removeRequirementCreators ( ) Remove all requirement creators
removeRequirements ( ) Remove all requirements
retrieveRequirement ( $name, $options = null ) : mixed Get the requirement matching the name provided
setConnectionGroup ( string $name, Shanty_Mongo_Connection_Group $connectionGroup ) Set a connection group
storeRequirement ( $name, $requirement ) Add requirements to use in validation of document properties
storeRequirementCreator ( $regex, Closure $function ) Add a creator of requirements

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

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

Add connections Shanty Mongo
public static addConnections ( array $options )
$options array

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

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

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

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

createRequirement() публичный статический Метод

Create a requirement
public static createRequirement ( $name, $options = null ) : mixed
$name String Name of requirement
Результат mixed

getConnectionGroup() публичный статический Метод

Get a connection group. If it doesn't already exist, create it
public static getConnectionGroup ( string $name ) : Shanty_Mongo_Connection_Group
$name string The name of the connection group
Результат Shanty_Mongo_Connection_Group

getConnectionGroups() публичный статический Метод

Get a list of all connection groups
public static getConnectionGroups ( ) : array
Результат array

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

Get a read connection
public static getReadConnection ( string $connectionGroupName = 'default' ) : Shanty_Mongo_Connection
$connectionGroupName string The connection group name
Результат Shanty_Mongo_Connection

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

Get a write connection
public static getWriteConnection ( string $connectionGroupName = 'default' ) : Shanty_Mongo_Connection
$connectionGroupName string The connection group name
Результат Shanty_Mongo_Connection

hasConnectionGroup() публичный статический Метод

Determine if a connection group exists
public static hasConnectionGroup ( string $name )
$name string The name of the connection group

init() публичный статический Метод

Initialise Shanty_Mongo. In particular all the requirements.
public static init ( )

isValidOperation() публичный статический Метод

Deterimine if an operation is valid
public static isValidOperation ( string $operation )
$operation string

makeClean() публичный статический Метод

Return Shanty_Mongo to pre-init status
public static makeClean ( )

removeConnectionGroups() публичный статический Метод

Remove all connection groups
public static removeConnectionGroups ( )

removeRequirementCreators() публичный статический Метод

Remove all requirement creators
public static removeRequirementCreators ( )

removeRequirements() публичный статический Метод

Remove all requirements
public static removeRequirements ( )

retrieveRequirement() публичный статический Метод

Get the requirement matching the name provided
public static retrieveRequirement ( $name, $options = null ) : mixed
$name String Name of requirement
Результат mixed

setConnectionGroup() публичный статический Метод

Set a connection group
public static setConnectionGroup ( string $name, Shanty_Mongo_Connection_Group $connectionGroup )
$name string
$connectionGroup Shanty_Mongo_Connection_Group

storeRequirement() публичный статический Метод

Add requirements to use in validation of document properties
public static storeRequirement ( $name, $requirement )
$name String Name of requirement
$requirement mixed

storeRequirementCreator() публичный статический Метод

Add a creator of requirements
public static storeRequirementCreator ( $regex, Closure $function )
$function Closure

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

$_connectionGroups защищенное статическое свойство

protected static $_connectionGroups

$_initialised защищенное статическое свойство

protected static $_initialised

$_requirementCreators защищенное статическое свойство

protected static $_requirementCreators

$_requirements защищенное статическое свойство

protected static $_requirements

$_validOperations защищенное статическое свойство

protected static $_validOperations