BigIntegerIdentityGenerator
extends AbstractIdGenerator
in package
Id generator that obtains IDs from special "identity" columns. These are columns that automatically get a database-generated, auto-incremented identifier on INSERT.
This generator obtains the last insert id after such an insert.
Table of Contents
Properties
- $alreadyDelegatedToGenerateId : bool
- $sequenceName : string|null
- The name of the sequence to pass to lastInsertId(), if any.
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
$alreadyDelegatedToGenerateId
private
bool
$alreadyDelegatedToGenerateId
= false
$sequenceName
The name of the sequence to pass to lastInsertId(), if any.
private
string|null
$sequenceName
Methods
__construct()
public
__construct([string|null $sequenceName = null ]) : mixed
Parameters
- $sequenceName : string|null = null
-
The name of the sequence to pass to lastInsertId() to obtain the last generated identifier within the current database session/connection, if any.
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