TableGenerator
extends AbstractIdGenerator
in package
Id generator that uses a single-row database table and a hi/lo algorithm.
Tags
Table of Contents
- $_allocationSize : int
- $_maxValue : int|null
- $_nextValue : int|null
- $_sequenceName : string
- $_tableName : string
- __construct() : mixed
- generate() : mixed
- Generates an identifier for an entity.
- isPostInsertGenerator() : bool
- 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.
Properties
$_allocationSize
private
int
$_allocationSize
$_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
Return values
mixed —generate()
Generates an identifier for an entity.
public
generate(EntityManager $em, mixed $entity) : mixed
Parameters
- $em : EntityManager
- $entity : mixed
Return values
mixed —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.
public
isPostInsertGenerator() : bool
By default, this method returns FALSE. Generators that have this requirement must override this method and return TRUE.