Apache Zeta Components Manual :: Docs For Class ezcPersistentNativeGenerator
PersistentObject::ezcPersistentNativeGenerator
Class ezcPersistentNativeGenerator
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. Other databases need to create a sequence per table.
auto_increment databases:
- CREATE TABLE test
- ( id integer unsigned not null auto_increment, PRIMARY KEY (id ));
Source for this file: /PersistentObject/src/generators/native_generator.php
ezcPersistentIdentifierGenerator | --ezcPersistentNativeGenerator
Version: | //autogen// |
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
)
No functionality, since database handles ID generation automatically. |
Inherited Methods
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. |
Methods
postSave
int
postSave(
ezcPersistentObjectDefinition
$def
,
$db
)
Returns the integer value of the generated identifier for the new object.
Called right after execution of the insert query.
Parameters:
Name | Type | Description |
---|---|---|
$def |
ezcPersistentObjectDefinition | |
$db |
ezcDbHandler |
Redefinition of:
Method | Description |
---|---|
ezcPersistentIdentifierGenerator::postSave() |
Returns the value of the generated identifier for the new object. |
preSave
void
preSave(
ezcPersistentObjectDefinition
$def
,
$db
,
$q
)
No functionality, since database handles ID generation automatically.
Parameters:
Name | Type | Description |
---|---|---|
$def |
ezcPersistentObjectDefinition | |
$db |
ezcDbHandler | |
$q |
ezcQueryInsert |
Redefinition of:
Method | Description |
---|---|
ezcPersistentIdentifierGenerator::preSave() |
Called prior to executing the insert query that saves the data to the database. |
Documentation generated by phpDocumentor 1.4.3