TableGenerator
extends AbstractIdGenerator
in package
Id generator that uses a single-row database table and a hi/lo algorithm.
Tags
Table of Contents
Properties
- $allocationSize : int
- $alreadyDelegatedToGenerateId : bool
- $maxValue : int|null
- $nextValue : int|null
- $sequenceName : string
- $tableName : string
Methods
- __construct() : mixed
- generate() : mixed
- Generates an identifier for an entity.
- generateId() : mixed
- Generates an identifier for an entity.
- 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.
Properties
$allocationSize
private
int
$allocationSize
$alreadyDelegatedToGenerateId
private
bool
$alreadyDelegatedToGenerateId
= false
$maxValue
private
int|null
$maxValue
$nextValue
private
int|null
$nextValue
$sequenceName
private
string
$sequenceName
$tableName
private
string
$tableName
Methods
__construct()
public
__construct(string $tableName[, string $sequenceName = 'default' ][, int $allocationSize = 10 ]) : mixed
Parameters
- $tableName : string
- $sequenceName : string = 'default'
- $allocationSize : int = 10
generate()
Generates an identifier for an entity.
public
generate(EntityManager $em, object|null $entity) : mixed
Parameters
- $em : EntityManager
- $entity : object|null
Tags
generateId()
Generates an identifier for an entity.
public
generateId(EntityManagerInterface $em, mixed $entity) : mixed
Parameters
- $em : EntityManagerInterface
- $entity : mixed
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.