1 | <?php |
||
2 | |||
3 | namespace Nip\Database\Query; |
||
4 | |||
5 | /** |
||
6 | * Class Delete |
||
7 | * @package Nip\Database\Query |
||
8 | */ |
||
9 | class Delete extends AbstractQuery |
||
10 | { |
||
11 | /** |
||
12 | * Joins together DELETE, FROM, WHERE, ORDER, and LIMIT parts of SQL query |
||
13 | * @return string |
||
14 | */ |
||
15 | public function assemble() |
||
16 | { |
||
17 | $query = "DELETE FROM {$this->getManager()->protect($this->getTable())}"; |
||
18 | |||
19 | $query .= $this->assembleWhere(); |
||
20 | |||
21 | $order = $this->parseOrder(); |
||
22 | if (!empty($order)) { |
||
23 | $query .= " order by {$order}"; |
||
24 | } |
||
25 | |||
26 | $query .= $this->assembleLimit(); |
||
27 | |||
28 | return $query; |
||
0 ignored issues
–
show
|
|||
29 | } |
||
30 | } |
||
31 |
In the issue above, the returned value is violating the contract defined by the mentioned interface.
Let's take a look at an example: