class IncrementGenerator extends AbstractIdGenerator (View source)

IncrementGenerator is responsible for generating auto increment identifiers. It uses a collection and generates the next id by using $inc on a field named "current_id".

The 'collection' property determines which collection name is used to store the id values. If not specified it defaults to 'doctrine_increment_ids'.

The 'key' property determines the document ID used to store the id values in the collection. If not specified it defaults to the name of the collection for the document.

Properties

protected $collection
protected $key
protected $startingId

Methods

mixed
generate(DocumentManager $dm, object $document)

No description

setCollection($collection)

No description

setKey($key)

No description

setStartingId($startingId)

No description

Details

mixed generate(DocumentManager $dm, object $document)

Parameters

DocumentManager $dm
object $document

Return Value

mixed

setCollection($collection)

Parameters

$collection

setKey($key)

Parameters

$key

setStartingId($startingId)

Parameters

$startingId