Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
Database.php
Go to the documentation of this file.
1 <?php
2 namespace Elgg\Application;
3 
5 use Elgg\Database as ElggDb;
6 use Elgg\Timer;
7 use Elgg\Logger;
8 
20 class Database extends ElggDb {
21 
27  private $db;
28 
35  public function __construct(ElggDb $db) {
36  $this->db = $db;
37  }
38 
42  public function getData($query, $callback = '', array $params = []) {
43  return $this->db->getData($query, $callback, $params);
44  }
45 
49  public function getDataRow($query, $callback = '', array $params = []) {
50  return $this->db->getDataRow($query, $callback, $params);
51  }
52 
56  public function insertData($query, array $params = []) {
57  return $this->db->insertData($query, $params);
58  }
59 
63  public function updateData($query, $getNumRows = false, array $params = []) {
64  return $this->db->updateData($query, $getNumRows, $params);
65  }
66 
70  public function deleteData($query, array $params = []) {
71  return $this->db->deleteData($query, $params);
72  }
73 
77  public function getTablePrefix() {
78  return $this->db->getTablePrefix();
79  }
80 
84  public function sanitizeInt($value, $signed = true) {
85  return $this->db->sanitizeInt($value, $signed);
86  }
87 
91  public function sanitizeString($value) {
92  return $this->db->sanitizeString($value);
93  }
94 
100  public function fingerprintCallback($callback) {
101  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
102  return $this->db->fingerprintCallback($callback);
103  }
104 
110  public function setTimer(Timer $timer) {
111  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
112  $this->db->setTimer($timer);
113  }
114 
120  public function setLogger(Logger $logger) {
121  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
122  $this->db->setLogger($logger);
123  }
124 
130  public function setupConnections() {
131  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
132  $this->db->setupConnections();
133  }
134 
140  public function connect($type = "readwrite") {
141  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
142  $this->db->connect($type);
143  }
144 
150  public function runSqlScript($scriptlocation) {
151  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
152  $this->db->runSqlScript($scriptlocation);
153  }
154 
160  public function registerDelayedQuery($query, $type, $handler = "", array $params = []) {
161  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
162  return $this->db->registerDelayedQuery($query, $type, $handler, $params);
163  }
164 
170  public function executeDelayedQueries() {
171  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
172  $this->db->executeDelayedQueries();
173  }
174 
180  public function enableQueryCache() {
181  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
182  $this->db->enableQueryCache();
183  }
184 
190  public function disableQueryCache() {
191  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
192  $this->db->disableQueryCache();
193  }
194 
200  public function assertInstalled() {
201  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
202  $this->db->assertInstalled();
203  }
204 
210  public function getQueryCount() {
211  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
212  return $this->db->getQueryCount();
213  }
214 
220  public function getServerVersion($type) {
221  elgg_deprecated_notice(__METHOD__ . " was deprecated and will be removed in 3.0", '2.1');
222  return $this->db->getServerVersion($type);
223  }
224 }
__construct(ElggDb $db)
Constructor.
Definition: Database.php:35
fingerprintCallback($callback)
{}
Definition: Database.php:100
setTimer(Timer $timer)
{}
Definition: Database.php:110
getDataRow($query, $callback= '', array $params=[])
{}
Definition: Database.php:49
setLogger(Logger $logger)
{}
Definition: Database.php:120
runSqlScript($scriptlocation)
{}
Definition: Database.php:150
$value
Definition: longtext.php:26
insertData($query, array $params=[])
{}
Definition: Database.php:56
Capture timing info for profiling.
Definition: Timer.php:9
sanitizeString($value)
{}
Definition: Database.php:91
$params
Definition: login.php:72
sanitizeInt($value, $signed=true)
{}
Definition: Database.php:84
registerDelayedQuery($query, $type, $handler="", array $params=[])
{}
Definition: Database.php:160
deleteData($query, array $params=[])
{}
Definition: Database.php:70
elgg_deprecated_notice($msg, $dep_version, $backtrace_level=1)
Log a notice about deprecated use of a function, view, etc.
Definition: elgglib.php:1070
updateData($query, $getNumRows=false, array $params=[])
{}
Definition: Database.php:63
$handler
Definition: add.php:10
Elgg 2.0 public database API.
Definition: Database.php:20
getData($query, $callback= '', array $params=[])
{}
Definition: Database.php:42
if(!$display_name) $type
Definition: delete.php:27
connect($type="readwrite")
{}
Definition: Database.php:140