class SequenceGenerator implements Generator, Serializable (View source)

Represents an ID generator that uses a database sequence.

Methods

__construct(string $sequenceName, int $allocationSize)

No description

string|int
generate(EntityManagerInterface $em, object|null $entity)

Generates an identifier for an entity.

getCurrentMaxValue()

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

getNextValue()

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

serialize()

No description

unserialize(string $serialized)

No description

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.

Details

__construct(string $sequenceName, int $allocationSize)

Parameters

string $sequenceName
int $allocationSize

string|int generate(EntityManagerInterface $em, object|null $entity)

Generates an identifier for an entity.

Parameters

EntityManagerInterface $em
object|null $entity

Return Value

string|int

getCurrentMaxValue()

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

getNextValue()

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

serialize()

unserialize(string $serialized)

Parameters

string $serialized

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.