IdGenerator Class Reference

Inherited by MSSQLIdGenerator, MySQLIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.

List of all members.

Public Member Functions


Member Function Documentation

IdGenerator::SEQUENCE ()

 

SEQUENCE id generator type

IdGenerator::AUTOINCREMENT ()

 

AUTO INCREMENT id generator type

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()

Reimplemented in MSSQLIdGenerator, MySQLIdGenerator, 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()

Reimplemented in MSSQLIdGenerator, MySQLIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.

IdGenerator::getIdMethod ()

 

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

Returns int SEQUENCE or AUTOINCREMENT

Reimplemented in MSSQLIdGenerator, MySQLIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.

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.

Reimplemented in MSSQLIdGenerator, MySQLIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.


This file is part of the Creole[php4] library.


Copyright © 2004 Hans Lellelid  
Creole[php4] CVS