| Conditions | 5 |
| Paths | 16 |
| Total Lines | 19 |
| Code Lines | 13 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 12 |
| CRAP Score | 5.0113 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 10 | 1 | public function getSQL() |
|
| 11 | { |
||
| 12 | 1 | $delete = "DELETE FROM " . $this->buildNodes(); |
|
| 13 | |||
| 14 | 1 | $where = count($this->conditions) |
|
| 15 | 1 | ? "\nWHERE " . $this->buildConditions() |
|
| 16 | 1 | : ''; // no conditions present |
|
| 17 | |||
| 18 | 1 | $order = count($this->order) |
|
| 19 | ? "\nORDER BY " . $this->buildOrderTerms() |
||
| 20 | 1 | : ''; // no order terms |
|
| 21 | |||
| 22 | 1 | $limit = $this->limit !== null |
|
| 23 | 1 | ? "\nLIMIT {$this->limit}" |
|
| 24 | 1 | . ($this->offset !== null ? " OFFSET {$this->offset}" : '') |
|
| 25 | 1 | : ''; // no limit or offset |
|
| 26 | |||
| 27 | 1 | return "{$delete}{$where}{$order}{$limit}"; |
|
| 28 | } |
||
| 29 | } |
||
| 30 |