PHP Class Shanty_Mongo_Connection_Stack

Author: Coen Hyde
Inheritance: implements SeekableIterator, implements Countable, implements ArrayAccess
Datei anzeigen Open project: coen-hyde/shanty-mongo

Protected Properties

Property Type Description
$_cacheConnectionSelection
$_cachedConnection
$_nodes
$_options
$_position
$_weights

Public Methods

Method Description
addNode ( Shanty_Mongo_Connection $connection, integer $weight = 1 ) Add node to connection stack
cacheConnectionSelection ( boolean $value = null ) Get or set the flag to determine if the first connection selection should be cached
count ( ) Count all the connections
current ( ) : Shanty_Mongo_Connection Get the current connection
getCachedConnection ( ) : Shanty_Mongo_Connection Get the cached connection
getOption ( string $option ) Get an option
hasCachedConnection ( ) : boolean Determine if this connection stack has a cached connection
key ( ) : integer Get teh current key
next ( ) Move the pointer to the next connection
offsetExists ( integer $offset ) Test if an offset exists
offsetGet ( integer $offset ) Get an offset
offsetSet ( Shanty_Mongo_Connection $offset, $connection ) Set an offset
offsetUnset ( integer $offset ) Unset an offset
rewind ( ) Rewind the pointer to the begining of the stack
seek ( $position ) Seek to a particular connection
selectNode ( ) : Shanty_Mongo_Connection Select a node from the connection stack.
setOption ( string $option, mixed $value ) Set an option
setOptions ( array $options ) Set Options
valid ( ) Is the location of the current pointer valid

Method Details

addNode() public method

Add node to connection stack
public addNode ( Shanty_Mongo_Connection $connection, integer $weight = 1 )
$connection Shanty_Mongo_Connection
$weight integer

cacheConnectionSelection() public method

Get or set the flag to determine if the first connection selection should be cached
public cacheConnectionSelection ( boolean $value = null )
$value boolean

count() public method

Count all the connections
public count ( )

current() public method

Get the current connection
public current ( ) : Shanty_Mongo_Connection
return Shanty_Mongo_Connection

getCachedConnection() public method

Get the cached connection
public getCachedConnection ( ) : Shanty_Mongo_Connection
return Shanty_Mongo_Connection

getOption() public method

Get an option
public getOption ( string $option )
$option string

hasCachedConnection() public method

Determine if this connection stack has a cached connection
public hasCachedConnection ( ) : boolean
return boolean

key() public method

Get teh current key
public key ( ) : integer
return integer

next() public method

Move the pointer to the next connection
public next ( )

offsetExists() public method

Test if an offset exists
public offsetExists ( integer $offset )
$offset integer

offsetGet() public method

Get an offset
public offsetGet ( integer $offset )
$offset integer

offsetSet() public method

Set an offset
public offsetSet ( Shanty_Mongo_Connection $offset, $connection )
$offset Shanty_Mongo_Connection
$connection

offsetUnset() public method

Unset an offset
public offsetUnset ( integer $offset )
$offset integer

rewind() public method

Rewind the pointer to the begining of the stack
public rewind ( )

seek() public method

Seek to a particular connection
public seek ( $position )
$position

selectNode() public method

Select a node from the connection stack.
public selectNode ( ) : Shanty_Mongo_Connection
return Shanty_Mongo_Connection

setOption() public method

Set an option
public setOption ( string $option, mixed $value )
$option string
$value mixed

setOptions() public method

Set Options
public setOptions ( array $options )
$options array

valid() public method

Is the location of the current pointer valid
public valid ( )

Property Details

$_cacheConnectionSelection protected_oe property

protected $_cacheConnectionSelection

$_cachedConnection protected_oe property

protected $_cachedConnection

$_nodes protected_oe property

protected $_nodes

$_options protected_oe property

protected $_options

$_position protected_oe property

protected $_position

$_weights protected_oe property

protected $_weights