Conditions | 5 |
Paths | 8 |
Total Lines | 18 |
Code Lines | 13 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
74 | public function __construct(string $table, array $fields, array $where, |
||
75 | array $group, array $order = [], int $limit = 1, int $page = 0) |
||
76 | { |
||
77 | $this->table = $table; |
||
78 | $this->fields = $fields; |
||
79 | $this->where = $where; |
||
80 | $this->group = $group; |
||
81 | $this->order = $order; |
||
82 | $this->limit = $limit; |
||
83 | $this->page = $page; |
||
84 | if (!empty($where)) { |
||
85 | $this->clauses = ' WHERE ' . \implode(' AND ', $where); |
||
86 | } |
||
87 | if (!empty($group) && count($group) < count($fields)) { |
||
88 | $this->clauses .= ' GROUP BY ' . \implode(', ', $group); |
||
89 | } |
||
90 | if (!empty($order)) { |
||
91 | $this->clauses .= ' ORDER BY ' . \implode(', ', $order); |
||
92 | } |
||
95 |