|
1
|
|
|
<?php |
|
2
|
|
|
/** |
|
3
|
|
|
* @copyright Copyright (c) 2016, ownCloud, Inc. |
|
4
|
|
|
* |
|
5
|
|
|
* @author Bart Visscher <[email protected]> |
|
6
|
|
|
* @author Dan Bartram <[email protected]> |
|
7
|
|
|
* @author Frank Karlitschek <[email protected]> |
|
8
|
|
|
* @author Joas Schilling <[email protected]> |
|
9
|
|
|
* @author Jörn Friedrich Dreyer <[email protected]> |
|
10
|
|
|
* @author Lukas Reschke <[email protected]> |
|
11
|
|
|
* @author Morris Jobke <[email protected]> |
|
12
|
|
|
* @author Robin Appelman <[email protected]> |
|
13
|
|
|
* @author Roeland Jago Douma <[email protected]> |
|
14
|
|
|
* @author Thomas Müller <[email protected]> |
|
15
|
|
|
* @author Thomas Tanghus <[email protected]> |
|
16
|
|
|
* |
|
17
|
|
|
* @license AGPL-3.0 |
|
18
|
|
|
* |
|
19
|
|
|
* This code is free software: you can redistribute it and/or modify |
|
20
|
|
|
* it under the terms of the GNU Affero General Public License, version 3, |
|
21
|
|
|
* as published by the Free Software Foundation. |
|
22
|
|
|
* |
|
23
|
|
|
* This program is distributed in the hope that it will be useful, |
|
24
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
25
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
26
|
|
|
* GNU Affero General Public License for more details. |
|
27
|
|
|
* |
|
28
|
|
|
* You should have received a copy of the GNU Affero General Public License, version 3, |
|
29
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/> |
|
30
|
|
|
* |
|
31
|
|
|
*/ |
|
32
|
|
|
|
|
33
|
|
|
/** |
|
34
|
|
|
* Public interface of ownCloud for apps to use. |
|
35
|
|
|
* DB Class |
|
36
|
|
|
* |
|
37
|
|
|
*/ |
|
38
|
|
|
|
|
39
|
|
|
// use OCP namespace for all classes that are considered public. |
|
40
|
|
|
// This means that they should be used by apps instead of the internal ownCloud classes |
|
41
|
|
|
namespace OCP; |
|
42
|
|
|
|
|
43
|
|
|
/** |
|
44
|
|
|
* This class provides access to the internal database system. Use this class exlusively if you want to access databases |
|
45
|
|
|
* @deprecated 8.1.0 use methods of \OCP\IDBConnection - \OC::$server->getDatabaseConnection() |
|
46
|
|
|
* @since 4.5.0 |
|
47
|
|
|
*/ |
|
48
|
|
|
class DB { |
|
49
|
|
|
/** |
|
50
|
|
|
* Prepare a SQL query |
|
51
|
|
|
* @param string $query Query string |
|
52
|
|
|
* @param int $limit Limit of the SQL statement |
|
53
|
|
|
* @param int $offset Offset of the SQL statement |
|
54
|
|
|
* @return \OC_DB_StatementWrapper prepared SQL query |
|
55
|
|
|
* |
|
56
|
|
|
* SQL query via Doctrine prepare(), needs to be execute()'d! |
|
57
|
|
|
* @deprecated 8.1.0 use prepare() of \OCP\IDBConnection - \OC::$server->getDatabaseConnection() |
|
58
|
|
|
* @since 4.5.0 |
|
59
|
|
|
*/ |
|
60
|
|
|
static public function prepare( $query, $limit=null, $offset=null ) { |
|
|
|
|
|
|
61
|
|
|
return \OC_DB::prepare($query, $limit, $offset); |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
|
|
} |
|
65
|
|
|
|