PHP Class Mongolid\Util\SequenceService

Datei anzeigen Open project: leroy-merlin-br/mongolid

Protected Properties

Property Type Description
$collection string Sequences collection name on MongoDB. Default 'mongolid_sequences'.
$connPool Mongolid\Connection\Pool Connections that are going to be used to interact with the database.

Public Methods

Method Description
__construct ( Pool $connPool, string $collection = 'mongolid_sequences' )
getNextValue ( string $sequenceName ) : integer Get next value for the sequence.

Protected Methods

Method Description
rawCollection ( ) : MongoDB\Collection Get the actual MongoDB Collection object.

Method Details

__construct() public method

public __construct ( Pool $connPool, string $collection = 'mongolid_sequences' )
$connPool Mongolid\Connection\Pool The connections that are going to be used to interact with the database.
$collection string The collection where the sequences will be stored.

getNextValue() public method

Get next value for the sequence.
public getNextValue ( string $sequenceName ) : integer
$sequenceName string Sequence identifier string.
return integer

rawCollection() protected method

Get the actual MongoDB Collection object.
protected rawCollection ( ) : MongoDB\Collection
return MongoDB\Collection

Property Details

$collection protected_oe property

Sequences collection name on MongoDB. Default 'mongolid_sequences'.
protected string $collection
return string

$connPool protected_oe property

Connections that are going to be used to interact with the database.
protected Pool,Mongolid\Connection $connPool
return Mongolid\Connection\Pool