class SequenceGenerator extends AbstractIdGenerator implements Serializable (View source)

Represents an ID generator that uses a database sequence.

Methods

mixed
generate(EntityManager $em, Entity $entity)

Generates an identifier for an entity.

boolean
isPostInsertGenerator()

Gets whether this generator is a post-insert generator which means that {@link generate()} must be called after the entity has been inserted into the database.

__construct(string $sequenceName, integer $allocationSize)

Initializes a new sequence generator.

integer|null
getCurrentMaxValue()

Gets the maximum value of the currently allocated bag of values.

integer
getNextValue()

Gets the next value that will be returned by generate().

string
serialize()

No description

void
unserialize(string $serialized)

No description

Details

mixed generate(EntityManager $em, Entity $entity)

Generates an identifier for an entity.

Parameters

EntityManager $em
Entity $entity

Return Value

mixed

boolean isPostInsertGenerator()

Gets whether this generator is a post-insert generator which means that {@link generate()} must be called after the entity has been inserted into the database.

By default, this method returns FALSE. Generators that have this requirement must override this method and return TRUE.

Return Value

boolean

__construct(string $sequenceName, integer $allocationSize)

Initializes a new sequence generator.

Parameters

string $sequenceName The name of the sequence.
integer $allocationSize The allocation size of the sequence.

integer|null getCurrentMaxValue()

Gets the maximum value of the currently allocated bag of values.

Return Value

integer|null

integer getNextValue()

Gets the next value that will be returned by generate().

Return Value

integer

string serialize()

Return Value

string

void unserialize(string $serialized)

Parameters

string $serialized

Return Value

void