Conditions | 6 |
Paths | 24 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
4 | public function select($table, $criteria, $args, $options = []) { |
||
5 | $where = $criteria ? ' WHERE ' . $criteria : ''; |
||
6 | $limit = (isset($options['limit'])) ? ' LIMIT ' . $options['limit'] : ''; |
||
7 | |||
8 | if (isset($options['offset'])) { |
||
9 | $offset = ' OFFSET ' . $options['offset']; |
||
10 | if (!$limit) $limit = ' LIMIT 1000'; |
||
11 | } |
||
12 | else $offset = ''; |
||
13 | |||
14 | $order = isset($options['order']) ? ' ORDER BY ' . $options['order'] : ''; |
||
15 | return new Query('SELECT * FROM ' . $table . ' ' . $where . $order . $limit . $offset, $args); |
||
16 | } |
||
24 |