Reorder and new queries, also change to Query/Builder
This commit is contained in:
27
src/Implement/Database/Query/Delete.php
Normal file
27
src/Implement/Database/Query/Delete.php
Normal file
@ -0,0 +1,27 @@
|
||||
<?php
|
||||
namespace ProVM\Implement\Database\Query;
|
||||
|
||||
use ProVM\Concept\Database;
|
||||
use ProVM\Implement\Database\Query;
|
||||
|
||||
abstract class Delete extends Query implements Database\Query\Delete
|
||||
{
|
||||
use hasTable, hasConditions;
|
||||
|
||||
public function from(string $table): Database\Query\Delete
|
||||
{
|
||||
return $this->setTable($table);
|
||||
}
|
||||
public function where(array|string $conditions): Database\Query\Delete
|
||||
{
|
||||
return $this->setConditions($conditions);
|
||||
}
|
||||
|
||||
public function build(): string
|
||||
{
|
||||
return implode('', [
|
||||
"DELETE FROM {$this->getTable()}",
|
||||
$this->getConditionsString()
|
||||
]);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user