Doctrine


Doctrine\ORM\Id\SequenceGenerator
/Doctrine/ORM/Id/SequenceGenerator.php at line 32

Class SequenceGenerator

Class:SequenceGenerator - Superclass: AbstractIdGenerator
AbstractIdGenerator
⌊ SequenceGenerator

public class SequenceGenerator
extends AbstractIdGenerator

Represents an ID generator that uses a database sequence.

Since:
2.0
Author:
Roman Borschel

Constructor Summary

SequenceGenerator(string sequenceName, integer allocationSize, Doctrine\ORM\EntityManager em)

Initializes a new sequence generator.

Method Summary
integer|float

generate(mixed em, object entity)

Generates an ID for the given entity.

integer|float

getCurrentMaxValue()

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

integer|float

getNextValue()

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

void

serialize()

void

unserialize(mixed serialized)

Methods inherited from Doctrine\ORM\Id\AbstractIdGenerator
generate, isPostInsertGenerator

Constructor Detail

/Doctrine/ORM/Id/SequenceGenerator.php at line 46

SequenceGenerator

public SequenceGenerator(string sequenceName, integer allocationSize, Doctrine\ORM\EntityManager em)

Initializes a new sequence generator.

Parameters:
em - The EntityManager to use.
sequenceName - The name of the sequence.
allocationSize - The allocation size of the sequence.

Method Detail

/Doctrine/ORM/Id/SequenceGenerator.php at line 59

generate

public integer|float generate(mixed em, object entity)

Generates an ID for the given entity.

Returns:
The generated value.
Override.

/Doctrine/ORM/Id/SequenceGenerator.php at line 76

getCurrentMaxValue

public integer|float getCurrentMaxValue()

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


/Doctrine/ORM/Id/SequenceGenerator.php at line 86

getNextValue

public integer|float getNextValue()

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


/Doctrine/ORM/Id/SequenceGenerator.php at line 91

serialize

public void serialize()

/Doctrine/ORM/Id/SequenceGenerator.php at line 99

unserialize

public void unserialize(mixed serialized)

Doctrine