ILIAS  trunk Revision v11.0_alpha-1731-gff9cd7e2bd3
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
Wrapper.php
Go to the documentation of this file.
1 <?php
2 
19 declare(strict_types=1);
20 
22 
23 class Wrapper implements WrapperInterface
24 {
25  protected \ilDBInterface $db;
26 
27  public function __construct(\ilDBInterface $db)
28  {
29  $this->db = $db;
30  }
31 
32  public function nextID(string $table): int
33  {
34  return $this->db->nextId($table);
35  }
36 
37  public function query(string $query): \Generator
38  {
39  $result = $this->db->query($query);
40 
41  while ($row = $this->db->fetchAssoc($result)) {
42  yield $row;
43  }
44  }
45 
46  public function manipulate(string $query): void
47  {
48  $this->db->manipulate($query);
49  }
50 
51  public function update(string $table, array $values, array $where): void
52  {
53  $this->db->update(
54  $table,
55  $values,
56  $where
57  );
58  }
59 
60  public function insert(string $table, array $values): void
61  {
62  $this->db->insert(
63  $table,
64  $values
65  );
66  }
67 
68  public function quoteInteger(int $integer): string
69  {
70  return $this->db->quote($integer, \ilDBConstants::T_INTEGER);
71  }
72 }
update(string $table, array $values, array $where)
Definition: Wrapper.php:51
insert(string $table, array $values)
Definition: Wrapper.php:60