Path

ez components / documentation / api reference / 2007.1.1 / persistentobject


eZ Components 2007.1.1

PersistentObject: ezcPersistentManualGenerator

[ Tutorial ] [ Class tree ] [ Element index ] [ ChangeLog ] [ Credits ]

Class: ezcPersistentManualGenerator

This identifier generator does not generate any ID's. Instead the user must manually assign an ID when the object is saved. [source]
This is useful don't want any automatic id generation.

Parents

ezcPersistentIdentifierGenerator
   |
   --ezcPersistentManualGenerator

Method Summary

public void checkPersistence( $def, $db, $state )
Returns true if the object is persistent already.
public int postSave( $def, $db )
Returns the value of the generated identifier for the new object.
public void preSave( $def, $db, $q )
Sets the correct id on the insert query.

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

checkPersistence

void checkPersistence( ezcPersistentObjectDefinition $def, $db, $state )
Returns true if the object is persistent already.
Called in the beginning of the save process.
Persistent objects that are being saved must not exist in the database already.

Parameters

Name Type Description
$def ezcPersistentObjectDefinition  
$db ezcDbHandler  
$state array(key=>value)  

Redefinition of

Method Description
ezcPersistentIdentifierGenerator::checkPersistence() Returns true if the object is persistent already.

postSave

int postSave( ezcPersistentObjectDefinition $def, $db )
Returns the 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 )
Sets the correct id on the insert query.

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.

Last updated: Wed, 28 Nov 2007