PersistentObject: ezcPersistentSequenceGenerator
[ ]
[ ]
[ ]
[ ]
[ ]
Class: ezcPersistentSequenceGenerator
|
Generates IDs based on the PDO::lastInsertId method. [
source]
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:
1. CREATE TABLE test ( id integer unsigned not null, PRIMARY KEY (id ));
2. CREATE SEQUENCE test_seq START 1;
This class reads the parameters:
- sequence - The name of the database sequence keeping track of the ID. This field should be ommited for databases
supporting auto_increment.
Parents
ezcPersistentIdentifierGenerator
|
--ezcPersistentSequenceGenerator
Method Summary
|
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. |
Methods
postSave
Returns the integer value of the generated identifier for the new object.
Parameters
preSave
Fetches the next sequence value for PostgreSQL and Oracle implementations.
Parameters
Last updated: Thu, 01 Nov 2007