28 lines
651 B
PHP
28 lines
651 B
PHP
<?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()
|
|
]);
|
|
}
|
|
}
|