Elgg  Version master
Database.php
Go to the documentation of this file.
1 <?php
2 
3 namespace Elgg\Application;
4 
7 use Elgg\Database as ElggDb;
8 
16 class Database {
17 
23  public function __construct(protected ElggDb $db) {
24  }
25 
41  public function getData(QueryBuilder $query, $callback = '') {
42  return $this->db->getData($query, $callback);
43  }
44 
57  public function getDataRow(QueryBuilder $query, $callback = '') {
58  return $this->db->getDataRow($query, $callback);
59  }
60 
71  public function insertData(QueryBuilder $query) {
72  return $this->db->insertData($query);
73  }
74 
85  public function updateData(QueryBuilder $query, bool $getNumRows = false) {
86  return $this->db->updateData($query, $getNumRows);
87  }
88 
98  public function deleteData(QueryBuilder $query): int {
99  return $this->db->deleteData($query);
100  }
101 
110  public function getConnection($type) {
111  return $this->db->getConnection($type);
112  }
113 
126  public function registerDelayedQuery(QueryBuilder $query, $callback = null): void {
127  $this->db->registerDelayedQuery($query, $callback);
128  }
129 
136  public function __get($name) {
137  return $this->db->{$name};
138  }
139 
147  public function __set($name, $value) {
148  $this->db->{$name} = $value;
149  }
150 }
getConnection($type)
Gets (if required, also creates) a DB connection.
Definition: Database.php:110
__construct(protected ElggDb $db)
Constructor.
Definition: Database.php:23
if(!$user||!$user->canDelete()) $name
Definition: delete.php:22
insertData(QueryBuilder $query)
Insert a row into the database.
Definition: Database.php:71
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
Definition: LICENSE.txt:215
$type
Definition: delete.php:21
$value
Definition: generic.php:51
registerDelayedQuery(QueryBuilder $query, $callback=null)
Queue a query for execution upon shutdown.
Definition: Database.php:126
updateData(QueryBuilder $query, bool $getNumRows=false)
Update the database.
Definition: Database.php:85
foreach($recommendedExtensions as $extension) if(empty(ini_get('session.gc_probability'))||empty(ini_get('session.gc_divisor'))) $db
deleteData(QueryBuilder $query)
Delete data from the database.
Definition: Database.php:98
__set($name, $value)
Handle magic property writes.
Definition: Database.php:147
$query
__get($name)
Handle magic property reads.
Definition: Database.php:136
getDataRow(QueryBuilder $query, $callback= '')
Retrieve a single row from the database.
Definition: Database.php:57
getData(QueryBuilder $query, $callback= '')
Retrieve rows from the database.
Definition: Database.php:41