File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -120,19 +120,23 @@ public function buildInsertQuery()
120120
121121 public function buildUpdateQuery ()
122122 {
123+ $ query = "UPDATE {$ this ->delimitedTable } SET ?set " . $ this ->tryDelimite ($ this ->buildConditions ());
123124 if ($ this ->limit !== NULL || $ this ->offset ) {
124- throw new Nette \ NotSupportedException ( ' LIMIT clause is not supported in UPDATE query. ' );
125+ $ this -> driver -> applyLimit ( $ query , $ this -> limit , $ this -> offset );
125126 }
126- return "UPDATE {$ this ->delimitedTable } SET ?set " . $ this ->tryDelimite ($ this ->buildConditions ());
127+
128+ return $ query ;
127129 }
128130
129131
130132 public function buildDeleteQuery ()
131133 {
134+ $ query = "DELETE FROM {$ this ->delimitedTable }" . $ this ->tryDelimite ($ this ->buildConditions ());
132135 if ($ this ->limit !== NULL || $ this ->offset ) {
133- throw new Nette \ NotSupportedException ( ' LIMIT clause is not supported in DELETE query. ' );
136+ $ this -> driver -> applyLimit ( $ query , $ this -> limit , $ this -> offset );
134137 }
135- return "DELETE FROM {$ this ->delimitedTable }" . $ this ->tryDelimite ($ this ->buildConditions ());
138+
139+ return $ query ;
136140 }
137141
138142
You can’t perform that action at this time.
0 commit comments