db = $db; } function isBeforeInsert() { return false; } function isAfterInsert() { return true; } function getId($seq) { if ($this->db->isPostgres()) { $result = $this->db->fetchOneArray("SELECT nextval('$seq') AS nextval"); } else { $result = $this->db->fetchOneArray("SELECT last_insert_rowid() AS nextval"); } return intval($result['nextval']); } }