Zend Framework  3.0
Public Member Functions | Protected Attributes | List of all members
MongoDBOptions Class Reference

MongoDB session save handler Options. More...

Public Member Functions

 __construct ($options=null)
 {}
 
 __set ($key, $value)
 Override AbstractOptions::__set.
 
 setDatabase ($database)
 Set database name.
 
 getDatabase ()
 Get database name.
 
 setCollection ($collection)
 Set collection name.
 
 getCollection ()
 Get collection name.
 
 setSaveOptions (array $saveOptions)
 Set save options.
 
 getSaveOptions ()
 Get save options.
 
 setNameField ($nameField)
 Set name field.
 
 getNameField ()
 Get name field.
 
 setDataField ($dataField)
 Set data field.
 
 getDataField ()
 Get data field.
 
 setLifetimeField ($lifetimeField)
 Set lifetime field.
 
 getLifetimeField ()
 Get lifetime Field.
 
 setModifiedField ($modifiedField)
 Set Modified Field.
 
 getModifiedField ()
 Get modified Field.
 
 useExpireAfterSecondsIndex ()
 
 setUseExpireAfterSecondsIndex ($useExpireAfterSecondsIndex)
 Enable expireAfterSeconds index.
 
- Public Member Functions inherited from AbstractOptions
 __construct ($options=null)
 Constructor.
 
 setFromArray ($options)
 Set one or more configuration properties.
 
 toArray ()
 Cast to array.
 
 __set ($key, $value)
 Set a configuration property.
 
 __get ($key)
 Get a configuration property.
 
 __isset ($key)
 Test if a configuration property is null.
 
 __unset ($key)
 Set a configuration property to NULL.
 

Protected Attributes

 $database
 
 $collection
 
 $saveOptions = ['w' => 1]
 
 $nameField = 'name'
 
 $dataField = 'data'
 
 $lifetimeField = 'lifetime'
 
 $modifiedField = 'modified'
 
 $useExpireAfterSecondsIndex = false
 
- Protected Attributes inherited from AbstractOptions
 $__strictMode__ = true
 

Detailed Description

MongoDB session save handler Options.

Constructor & Destructor Documentation

__construct (   $options = null)

{}

Member Function Documentation

__set (   $key,
  $value 
)

Override AbstractOptions::__set.

Validates value if save options are being set.

Parameters
string$key
mixed$value

Implements ParameterObjectInterface.

getCollection ( )

Get collection name.

Returns
string
getDatabase ( )

Get database name.

Returns
string
getDataField ( )

Get data field.

Returns
string
getLifetimeField ( )

Get lifetime Field.

Returns
string
getModifiedField ( )

Get modified Field.

Returns
string
getNameField ( )

Get name field.

Returns
string
getSaveOptions ( )

Get save options.

Returns
string
setCollection (   $collection)

Set collection name.

Parameters
string$collection
Returns
MongoDBOptions
Exceptions
InvalidArgumentException
setDatabase (   $database)

Set database name.

Parameters
string$database
Returns
MongoDBOptions
Exceptions
InvalidArgumentException
setDataField (   $dataField)

Set data field.

Parameters
string$dataField
Returns
MongoDBOptions
Exceptions
InvalidArgumentException
setLifetimeField (   $lifetimeField)

Set lifetime field.

Parameters
string$lifetimeField
Returns
MongoDBOptions
Exceptions
InvalidArgumentException
setModifiedField (   $modifiedField)

Set Modified Field.

Parameters
string$modifiedField
Returns
MongoDBOptions
Exceptions
InvalidArgumentException
setNameField (   $nameField)

Set name field.

Parameters
string$nameField
Returns
MongoDBOptions
Exceptions
InvalidArgumentException
setSaveOptions ( array  $saveOptions)

Set save options.

See Also
http://php.net/manual/en/mongocollection.save.php
Parameters
array$saveOptions
Returns
MongoDBOptions
setUseExpireAfterSecondsIndex (   $useExpireAfterSecondsIndex)

Enable expireAfterSeconds index.

See Also
http://docs.mongodb.org/manual/tutorial/expire-data/
Parameters
boolean$useExpireAfterSecondsIndex
useExpireAfterSecondsIndex ( )
Returns
boolean

Member Data Documentation

$collection
protected
$database
protected
$dataField = 'data'
protected
$lifetimeField = 'lifetime'
protected
$modifiedField = 'modified'
protected
$nameField = 'name'
protected
$saveOptions = ['w' => 1]
protected
$useExpireAfterSecondsIndex = false
protected