Documentation

SequenceGenerator extends AbstractIdGenerator
in package
implements Serializable

Represents an ID generator that uses a database sequence.

Table of Contents

Interfaces

Serializable

Properties

$allocationSize  : int
The allocation size of the sequence.
$alreadyDelegatedToGenerateId  : bool
$maxValue  : int|null
$nextValue  : int
$sequenceName  : string
The name of the sequence.

Methods

__construct()  : mixed
Initializes a new sequence generator.
__serialize()  : array<string, mixed>
__unserialize()  : void
generate()  : mixed
Generates an identifier for an entity.
generateId()  : mixed
Generates an identifier for an entity.
getCurrentMaxValue()  : int|null
Gets the maximum value of the currently allocated bag of values.
getNextValue()  : int
Gets the next value that will be returned by generate().
isPostInsertGenerator()  : bool
Gets whether this generator is a post-insert generator which means that {@link generateId()} must be called after the entity has been inserted into the database.
serialize()  : string
unserialize()  : void

Properties

$allocationSize

The allocation size of the sequence.

private int $allocationSize

Methods

__construct()

Initializes a new sequence generator.

public __construct(string $sequenceName, int $allocationSize) : mixed
Parameters
$sequenceName : string

The name of the sequence.

$allocationSize : int

The allocation size of the sequence.

__serialize()

public __serialize() : array<string, mixed>
Return values
array<string, mixed>

__unserialize()

public __unserialize(array<string, mixed> $data) : void
Parameters
$data : array<string, mixed>

getCurrentMaxValue()

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

public getCurrentMaxValue() : int|null
Return values
int|null

getNextValue()

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

public getNextValue() : int
Return values
int

isPostInsertGenerator()

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

public isPostInsertGenerator() : bool

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

Return values
bool

unserialize()

public unserialize(string $serialized) : void
Parameters
$serialized : string
Tags
final

        
On this page

Search results