| @@ 86-106 (lines=21) @@ | ||
| 83 | /** |
|
| 84 | * @inheritdoc |
|
| 85 | */ |
|
| 86 | public function getSQL() |
|
| 87 | { |
|
| 88 | $update = "UPDATE " . $this->buildNodes(); |
|
| 89 | ||
| 90 | $set = "\nSET " . implode(",\n ", $this->assignments); |
|
| 91 | ||
| 92 | $where = count($this->conditions) |
|
| 93 | ? "\nWHERE " . $this->buildConditions() |
|
| 94 | : ''; // no conditions present |
|
| 95 | ||
| 96 | $order = count($this->order) |
|
| 97 | ? "\nORDER BY " . $this->buildOrderTerms() |
|
| 98 | : ''; // no order terms |
|
| 99 | ||
| 100 | $limit = $this->limit !== null |
|
| 101 | ? "\nLIMIT {$this->limit}" |
|
| 102 | . ($this->offset !== null ? " OFFSET {$this->offset}" : '') |
|
| 103 | : ''; // no limit or offset |
|
| 104 | ||
| 105 | return "{$update}{$set}{$where}{$order}{$limit}"; |
|
| 106 | } |
|
| 107 | ||
| 108 | /** |
|
| 109 | * @param Column $column |
|
| @@ 96-116 (lines=21) @@ | ||
| 93 | /** |
|
| 94 | * @inheritdoc |
|
| 95 | */ |
|
| 96 | public function getSQL() |
|
| 97 | { |
|
| 98 | $select = "SELECT " . $this->return_vars->buildReturnVars(); |
|
| 99 | ||
| 100 | $from = "\nFROM " . $this->buildNodes(); |
|
| 101 | ||
| 102 | $where = count($this->conditions) |
|
| 103 | ? "\nWHERE " . $this->buildConditions() |
|
| 104 | : ''; // no conditions present |
|
| 105 | ||
| 106 | $order = count($this->order) |
|
| 107 | ? "\nORDER BY " . $this->buildOrderTerms() |
|
| 108 | : ''; // no order terms |
|
| 109 | ||
| 110 | $limit = $this->limit !== null |
|
| 111 | ? "\nLIMIT {$this->limit}" |
|
| 112 | . ($this->offset !== null ? " OFFSET {$this->offset}" : '') |
|
| 113 | : ''; // no limit or offset |
|
| 114 | ||
| 115 | return "{$select}{$from}{$where}{$order}{$limit}"; |
|
| 116 | } |
|
| 117 | ||
| 118 | /** |
|
| 119 | * @ignore string magic (enables creation of nested SELECT queries) |
|