PHP Class Horde_Lock_Mongo, horde

Author: Michael Slusarz ([email protected])
Inheritance: extends Horde_Lock
Exibir arquivo Open project: horde/horde

Protected Properties

Property Type Description
$_db MongoCollection The MongoDB Collection object for the cache data.
$_map array Ugly hack: lock driver written with assumption that it returns data as defined by SQL columns. So need to do mapping in this driver.

Public Methods

Method Description
__construct ( array $params = [] ) Constructor.
__destruct ( ) Destructor.
clearLock ( $lockid )
gc ( ) Do garbage collection needed for the driver.
getLockInfo ( $lockid )
getLocks ( $scope = null, $principal = null, $type = null )
resetLock ( $lockid, $lifetime )
setLock ( $requestor, $scope, $principal, $lifetime = 1, $type = Horde_Lock::TYPE_SHARED )

Protected Methods

Method Description
_mapFields ( $res ) : array Map return to SQL fields.

Method Details

__construct() public method

Constructor.
public __construct ( array $params = [] )
$params array Parameters:
  - collection: (string) The collection name.
  - mongo_db: [REQUIRED] (Horde_Mongo_Client) A MongoDB client object.

__destruct() public method

Destructor.
public __destruct ( )

_mapFields() protected method

Map return to SQL fields.
protected _mapFields ( $res ) : array
return array

clearLock() public method

public clearLock ( $lockid )

gc() public method

Do garbage collection needed for the driver.
public gc ( )

getLockInfo() public method

public getLockInfo ( $lockid )

getLocks() public method

public getLocks ( $scope = null, $principal = null, $type = null )

resetLock() public method

public resetLock ( $lockid, $lifetime )

setLock() public method

public setLock ( $requestor, $scope, $principal, $lifetime = 1, $type = Horde_Lock::TYPE_SHARED )

Property Details

$_db protected_oe property

The MongoDB Collection object for the cache data.
protected MongoCollection $_db
return MongoCollection

$_map protected_oe property

Ugly hack: lock driver written with assumption that it returns data as defined by SQL columns. So need to do mapping in this driver.
protected array $_map
return array