IdGenerator Interface Reference

Inheritance diagram for IdGenerator:

MSSQLIdGenerator MySQLIdGenerator MySQLiIdGenerator OCI8IdGenerator ODBCIdGenerator PgSQLIdGenerator SQLiteIdGenerator

List of all members.

Public Member Functions

 isBeforeInsert ()
 Convenience method that returns TRUE if id is generated before an INSERT statement.
 isAfterInsert ()
 Convenience method that returns TRUE if id is generated after an INSERT statement.
 getIdMethod ()
 Get the preferred type / style for generating ids for RDBMS.
 getId ($keyInfo=null)
 Get the autoincrement or sequence id given the current connection and any additional needed info (e.g.

Public Attributes

const SEQUENCE = 1
 SEQUENCE id generator type.
const AUTOINCREMENT = 2
 AUTO INCREMENT id generator type.


Detailed Description

Definition at line 10 of file IdGenerator.php.


Member Function Documentation

IdGenerator::getId ( keyInfo = null  ) 

Get the autoincrement or sequence id given the current connection and any additional needed info (e.g.

sequence name for sequences).

Note: if you take advantage of the fact that $keyInfo may not be specified you should make sure that your code is setup in such a way that it will be portable if you change from an RDBMS that uses AUTOINCREMENT to one that uses SEQUENCE (i.e. in which case you would need to specify sequence name).

Parameters:
mixed $keyInfo Any additional information (e.g. sequence name) needed to fetch the id.
Returns:
int The last id / next id.

Implemented in MSSQLIdGenerator, MySQLIdGenerator, MySQLiIdGenerator, ODBCIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.

IdGenerator::getIdMethod (  ) 

Get the preferred type / style for generating ids for RDBMS.

Returns:
int SEQUENCE or AUTOINCREMENT

Implemented in MSSQLIdGenerator, MySQLIdGenerator, MySQLiIdGenerator, ODBCIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.

IdGenerator::isAfterInsert (  ) 

Convenience method that returns TRUE if id is generated after an INSERT statement.

This is the same as checking whether the generator type is AUTOINCREMENT.

Returns:
boolean TRUE if gen id method is AUTOINCREMENT
See also:
getIdMethod()

Implemented in MSSQLIdGenerator, MySQLIdGenerator, MySQLiIdGenerator, ODBCIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.

IdGenerator::isBeforeInsert (  ) 

Convenience method that returns TRUE if id is generated before an INSERT statement.

This is the same as checking whether the generator type is SEQUENCE.

Returns:
boolean TRUE if gen id method is SEQUENCE
See also:
getIdMethod()

Implemented in MSSQLIdGenerator, MySQLIdGenerator, MySQLiIdGenerator, ODBCIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.


Member Data Documentation

AUTO INCREMENT id generator type.

Definition at line 16 of file IdGenerator.php.

SEQUENCE id generator type.

Definition at line 13 of file IdGenerator.php.


The documentation for this interface was generated from the following file:

Generated on Wed May 6 23:10:49 2009 for fareofficelib by  doxygen 1.5.8