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 string|null $collection
protected string|null $key
protected int $startingId

Methods

mixed
generate(DocumentManager $dm, object $document)

No description

setCollection(string $collection)

No description

setKey(string $key)

No description

setStartingId(int $startingId)

No description

Details

mixed generate(DocumentManager $dm, object $document)

Parameters

DocumentManager $dm
object $document

Return Value

mixed

setCollection(string $collection)

Parameters

string $collection

setKey(string $key)

Parameters

string $key

setStartingId(int $startingId)

Parameters

int $startingId