web-base/core/Driver/SQL/Query/Delete.class.php

28 lines
597 B
PHP
Raw Normal View History

2020-04-02 00:02:51 +02:00
<?php
namespace Driver\SQL\Query;
class Delete extends Query {
2020-04-03 17:39:58 +02:00
private string $table;
private array $conditions;
2020-04-02 00:02:51 +02:00
public function __construct($sql, $table) {
parent::__construct($sql);
$this->table = $table;
$this->conditions = array();
}
public function where(...$conditions) {
$this->conditions = array_merge($this->conditions, $conditions);
return $this;
}
public function execute() {
return $this->sql->executeDelete($this);
}
public function getTable() { return $this->table; }
public function getConditions() { return $this->conditions; }
2020-04-03 17:39:58 +02:00
}