Generates IDs based on the PDO::lastInsertId method.
It is recommended to use auto_increment id columns for databases supporting it. This includes MySQL and SQLite. Use ezcPersistentNativeGenerator for those!
For none auto_increment databases:
This class reads the parameters:
Source for this file: /PersistentObject/src/generators/sequence_generator.php
ezcPersistentIdentifierGenerator | --ezcPersistentSequenceGenerator
Version: | //autogen// |
public int |
postSave(
$def
, $db
)
Returns the integer value of the generated identifier for the new object. |
public void |
preSave(
$def
, $db
, $q
)
Fetches the next sequence value for PostgreSQL and Oracle implementations. |
From ezcPersistentIdentifierGenerator | |
---|---|
public bool |
ezcPersistentIdentifierGenerator::checkPersistence()
Returns true if the object is persistent already. |
public abstract int |
ezcPersistentIdentifierGenerator::postSave()
Returns the value of the generated identifier for the new object. |
public abstract void |
ezcPersistentIdentifierGenerator::preSave()
Called prior to executing the insert query that saves the data to the database. |
Returns the integer value of the generated identifier for the new object.
Called right after execution of the insert query. Dispatches to ezcPersistentNativeGenerator for MySQL.
Name | Type | Description |
---|---|---|
$def |
ezcPersistentObjectDefinition | |
$db |
ezcDbHandler |
Method | Description |
---|---|
ezcPersistentIdentifierGenerator::postSave() |
Returns the value of the generated identifier for the new object. |
Fetches the next sequence value for PostgreSQL and Oracle implementations.
Fetches the next sequence value for PostgreSQL and Oracle implementations. Dispatches to ezcPersistentNativeGenerator for MySQL.
Name | Type | Description |
---|---|---|
$def |
ezcPersistentObjectDefinition | |
$db |
ezcDbHandler | |
$q |
ezcQueryInsert |
Method | Description |
---|---|
ezcPersistentIdentifierGenerator::preSave() |
Called prior to executing the insert query that saves the data to the database. |