comment typos again
[moodle.git] / lib / dml / mssql_native_moodle_temptables.php
CommitLineData
7a3ade00 1<?php
2
3// This file is part of Moodle - http://moodle.org/
4//
5// Moodle is free software: you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation, either version 3 of the License, or
8// (at your option) any later version.
9//
10// Moodle is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15// You should have received a copy of the GNU General Public License
16// along with Moodle. If not, see <http://www.gnu.org/licenses/>.
17
18/**
19 * MSSQL specific temptables store. Needed because temporary tables
02df9cfd
PS
20 * are named differently than normal tables. Also used to be able to retrieve
21 * temp table names included in the get_tables() method of the DB.
7a3ade00 22 *
23 * @package moodlecore
24 * @subpackage DML
25 * @copyright 2009 onwards Eloy Lafuente (stronk7) {@link http://stronk7.com}
26 * @license http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
27 */
28
29require_once($CFG->libdir.'/dml/moodle_temptables.php');
30
31class mssql_native_moodle_temptables extends moodle_temptables {
32
33 /**
4b1ee2b3 34 * Add one temptable to the store.
7a3ade00 35 *
4b1ee2b3 36 * Overriden because MSSQL requires to add # for local (session) temporary
37 * tables before the prefix.
38 *
39 * Given one moodle temptable name (without prefix), add it to the store, with the
40 * key being the original moodle name and the value being the real db temptable name
41 * already prefixed
42 *
43 * Override and use this *only* if the database requires modification in the table name.
44 *
45 * @param string $tablename name without prefix of the table created as temptable
7a3ade00 46 */
4b1ee2b3 47 public function add_temptable($tablename) {
48 // TODO: throw exception if exists: if ($this->is_temptable...
49 $this->temptables[$tablename] = '#' . $this->prefix . $tablename;
7a3ade00 50 }
4b1ee2b3 51
7a3ade00 52}