diff --git a/src/Database/Query/MySQL/Delete.php b/src/Database/Query/MySQL/Delete.php new file mode 100644 index 0000000..fbce5cd --- /dev/null +++ b/src/Database/Query/MySQL/Delete.php @@ -0,0 +1,7 @@ +setLimit($limit); + if ($offset !== null) { + $this->setOffset($offset); + } + return $this; + } + protected int $limit; + public function setLimit(int $limit): Select + { + $this->limit = $limit; + return $this; + } + public function getLimit(): int + { + return $this->limit; + } + protected int $offset; + public function setOffset(int $offset): Select + { + $this->offset = $offset; + return $this; + } + public function getOffset(): int + { + return $this->offset; + } + + public function build(): string + { + $query = [parent::build()]; + if (isset($this->limit)) { + $query []= 'LIMIT'; + $query []= $this->getLimit(); + if (isset($this->offset)) { + $query []= 'OFFSET'; + $query []= $this->getOffset(); + } + } + return implode(' ', $query); + } +} diff --git a/src/Database/Query/MySQL/Update.php b/src/Database/Query/MySQL/Update.php new file mode 100644 index 0000000..26bfa64 --- /dev/null +++ b/src/Database/Query/MySQL/Update.php @@ -0,0 +1,7 @@ +