29 private static $sequence = array();
40 $this->dateFormat =
'd-M-Y';
41 $db->setAttribute(\PDO::ATTR_STRINGIFY_FETCHES,
true);
42 if (empty(self::$sequence)) {
43 $n = strlen($this->dbTableNamePrefix) + 6;
44 $sql =
'SELECT TABLE_NAME, DATA_DEFAULT FROM USER_TAB_COLUMNS ' .
45 "WHERE (TABLE_NAME LIKE UPPER('{$this->dbTableNamePrefix}lti2_%')) AND (COLUMN_NAME = UPPER(CONCAT(SUBSTR(TABLE_NAME, {$n}), '_pk')))";
46 $query = $this->db->prepare($sql);
47 if ($query->execute()) {
48 $row = $query->fetchAll(\PDO::FETCH_ASSOC);
49 foreach ($row as $entry) {
50 self::$sequence[substr($entry[
'TABLE_NAME'], strlen($this->dbTableNamePrefix))] = str_replace(
'nextval',
51 'currval', $entry[
'DATA_DEFAULT']);
64 $sql =
'SELECT ' . self::$sequence[strtoupper($tableName)] .
' FROM dual';
65 $query = $this->db->prepare($sql);
66 if ($query->execute()) {
67 $row = $query->fetch(\PDO::FETCH_ASSOC);
68 $pk = intval(array_values($row)[0]);
getLastInsertId($tableName)
$dbTableNamePrefix
Prefix for database table names.
Class to represent a tool consumer context.
Class to represent an LTI Data Connector for PDO connections.
__construct($db, $dbTableNamePrefix='')
Class constructor.
Class to represent a tool consumer nonce.
Class to represent a tool consumer resource link share.
Class to represent a tool consumer user.
Class to represent a tool consumer resource link share key.
Class to represent a tool consumer resource link.
Class to represent an LTI Data Connector for PDO variations for Oracle connections.