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 12 of file OCI8IdGenerator.php.
OCI8IdGenerator::__construct | ( | Connection $ | conn | ) |
Creates a new IdGenerator class, saves passed connection for use later by getId() method.
Connection | $conn |
Definition at line 22 of file OCI8IdGenerator.php.
00023 { 00024 $this->conn = $conn; 00025 }
OCI8IdGenerator::getId | ( | $ | name = null |
) |
Implements IdGenerator.
Definition at line 54 of file OCI8IdGenerator.php.
References ResultSet::FETCHMODE_NUM.
00055 { 00056 if ($name === null) { 00057 throw new SQLException("You must specify the sequence name when calling getId() method."); 00058 } 00059 $rs = $this->conn->executeQuery("select " . $name . ".nextval from dual", ResultSet::FETCHMODE_NUM); 00060 $rs->next(); 00061 return $rs->getInt(1); 00062 }
OCI8IdGenerator::getIdMethod | ( | ) |
Implements IdGenerator.
Definition at line 46 of file OCI8IdGenerator.php.
OCI8IdGenerator::isAfterInsert | ( | ) |
Implements IdGenerator.
Definition at line 38 of file OCI8IdGenerator.php.
OCI8IdGenerator::isBeforeInsert | ( | ) |
Implements IdGenerator.
Definition at line 30 of file OCI8IdGenerator.php.
OCI8IdGenerator::$conn [private] |