ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
Wrapper.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
22
23class 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}
insert(string $table, array $values)
Definition: Wrapper.php:60
update(string $table, array $values, array $where)
Definition: Wrapper.php:51
Interface ilDBInterface.