Public Member Functions | |
__construct (Connection $conn) | |
Creates a new IdGenerator class, saves passed connection for use later by getId() method. | |
isBeforeInsert () | |
isAfterInsert () | |
getIdMethod () | |
getId ($name=null) | |
Private Attributes | |
$conn | |
Connection object that instantiated this class. |
Definition at line 31 of file PgSQLIdGenerator.php.
PgSQLIdGenerator::__construct | ( | Connection $ | conn | ) |
Creates a new IdGenerator class, saves passed connection for use later by getId() method.
Connection | $conn |
Definition at line 41 of file PgSQLIdGenerator.php.
00042 { 00043 $this->conn = $conn; 00044 }
PgSQLIdGenerator::getId | ( | $ | name = null |
) |
Implements IdGenerator.
Definition at line 73 of file PgSQLIdGenerator.php.
References ResultSet::FETCHMODE_NUM.
00074 { 00075 if ($name === null) { 00076 throw new SQLException("You must specify the sequence name when calling getId() method."); 00077 } 00078 $rs = $this->conn->executeQuery("SELECT nextval('" . pg_escape_string ( $name ) . "')", ResultSet::FETCHMODE_NUM); 00079 $rs->next(); 00080 return $rs->getInt(1); 00081 }
PgSQLIdGenerator::getIdMethod | ( | ) |
Implements IdGenerator.
Definition at line 65 of file PgSQLIdGenerator.php.
PgSQLIdGenerator::isAfterInsert | ( | ) |
Implements IdGenerator.
Definition at line 57 of file PgSQLIdGenerator.php.
PgSQLIdGenerator::isBeforeInsert | ( | ) |
Implements IdGenerator.
Definition at line 49 of file PgSQLIdGenerator.php.
PgSQLIdGenerator::$conn [private] |