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. |
Definition at line 10 of file IdGenerator.php.
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).
mixed | $keyInfo Any additional information (e.g. sequence name) needed to fetch the id. |
Implemented in MSSQLIdGenerator, MySQLIdGenerator, MySQLiIdGenerator, ODBCIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.
IdGenerator::getIdMethod | ( | ) |
Get the preferred type / style for generating ids for RDBMS.
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.
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.
Implemented in MSSQLIdGenerator, MySQLIdGenerator, MySQLiIdGenerator, ODBCIdGenerator, OCI8IdGenerator, PgSQLIdGenerator, and SQLiteIdGenerator.
const IdGenerator::AUTOINCREMENT = 2 |
const IdGenerator::SEQUENCE = 1 |