v1.0.0
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@ -1,3 +1,6 @@
|
||||
# Composer
|
||||
**/vendor/
|
||||
**/*.lock
|
||||
|
||||
# PHPStorm
|
||||
**/.idea/
|
||||
|
22
composer.json
Normal file
22
composer.json
Normal file
@ -0,0 +1,22 @@
|
||||
{
|
||||
"name": "provm/query_builder",
|
||||
"type": "project",
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.5",
|
||||
"kint-php/kint": "^4.2"
|
||||
},
|
||||
"authors": [
|
||||
{
|
||||
"name": "Aldarien",
|
||||
"email": "aldarien85@gmail.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"psr/container": "^2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"ProVM\\": "src/"
|
||||
}
|
||||
}
|
||||
}
|
12
src/Alias/Database/Query.php
Normal file
12
src/Alias/Database/Query.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace ProVM\Alias\Database;
|
||||
|
||||
use ProVM\Concept\Database\Query as QueryInterface;
|
||||
|
||||
abstract class Query implements QueryInterface
|
||||
{
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->build();
|
||||
}
|
||||
}
|
59
src/Alias/Database/Query/Delete.php
Normal file
59
src/Alias/Database/Query/Delete.php
Normal file
@ -0,0 +1,59 @@
|
||||
<?php
|
||||
namespace ProVM\Alias\Database\Query;
|
||||
|
||||
use ProVM\Alias\Database\Query;
|
||||
use ProVM\Concept\Database\Query\Delete as DeleteInterface;
|
||||
|
||||
abstract class Delete extends Query implements DeleteInterface
|
||||
{
|
||||
public function from(string $table): DeleteInterface
|
||||
{
|
||||
return $this->setTable($table);
|
||||
}
|
||||
public function where(array $conditions): DeleteInterface
|
||||
{
|
||||
return $this->setConditions($conditions);
|
||||
}
|
||||
|
||||
protected string $table;
|
||||
public function setTable(string $table): DeleteInterface
|
||||
{
|
||||
$this->table = $table;
|
||||
return $this;
|
||||
}
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
protected array $conditions;
|
||||
public function setConditions(array $conditions): DeleteInterface
|
||||
{
|
||||
foreach ($conditions as $condition) {
|
||||
$this->addCondition($condition);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addCondition(string $expression): DeleteInterface
|
||||
{
|
||||
$this->conditions []= $expression;
|
||||
return $this;
|
||||
}
|
||||
public function getConditions(): array
|
||||
{
|
||||
return $this->conditions;
|
||||
}
|
||||
public function getConditionString(): string
|
||||
{
|
||||
return implode(' ', $this->getConditions());
|
||||
}
|
||||
|
||||
public function build(): string
|
||||
{
|
||||
return implode(' ', [
|
||||
'DELETE FROM',
|
||||
$this->getTable(),
|
||||
'WHERE',
|
||||
$this->getConditionString()
|
||||
]);
|
||||
}
|
||||
}
|
108
src/Alias/Database/Query/Insert.php
Normal file
108
src/Alias/Database/Query/Insert.php
Normal file
@ -0,0 +1,108 @@
|
||||
<?php
|
||||
namespace ProVM\Alias\Database\Query;
|
||||
|
||||
use ProVM\Alias\Database\Query;
|
||||
use ProVM\Concept\Database\Query\Insert as InsertInterface;
|
||||
use ProVM\Concept\Database\Query\Select;
|
||||
|
||||
abstract class Insert extends Query implements InsertInterface
|
||||
{
|
||||
public function into(string $table): InsertInterface
|
||||
{
|
||||
return $this->setTable($table);
|
||||
}
|
||||
public function columns(array $columns): InsertInterface
|
||||
{
|
||||
return $this->setColumns($columns);
|
||||
}
|
||||
public function values(array $values): InsertInterface
|
||||
{
|
||||
return $this->setValues($values);
|
||||
}
|
||||
public function select(Select $select): InsertInterface
|
||||
{
|
||||
return $this->setSelect($select);
|
||||
}
|
||||
|
||||
protected string $table;
|
||||
public function setTable(string $table): InsertInterface
|
||||
{
|
||||
$this->table = $table;
|
||||
return $this;
|
||||
}
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
protected array $columns;
|
||||
public function setColumns(array $columns): InsertInterface
|
||||
{
|
||||
foreach ($columns as $column) {
|
||||
$this->addColumn($column);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addColumn(string $column): InsertInterface
|
||||
{
|
||||
$this->columns []= $column;
|
||||
return $this;
|
||||
}
|
||||
public function getColumns(): array
|
||||
{
|
||||
return $this->columns;
|
||||
}
|
||||
public function getColumnString(): string
|
||||
{
|
||||
return implode(', ', $this->getColumns());
|
||||
}
|
||||
protected array $values;
|
||||
public function setValues(array $values): InsertInterface
|
||||
{
|
||||
foreach ($values as $value) {
|
||||
$this->addValue($value);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addValue(int|string $value): InsertInterface
|
||||
{
|
||||
if (!is_numeric($value)) {
|
||||
$value = "'{$value}'";
|
||||
}
|
||||
$this->values []= $value;
|
||||
return $this;
|
||||
}
|
||||
public function getValues(): array
|
||||
{
|
||||
return $this->values;
|
||||
}
|
||||
public function getValueString(): string
|
||||
{
|
||||
return implode(', ', $this->getValues());
|
||||
}
|
||||
protected Select $select;
|
||||
public function setSelect(Select $select): InsertInterface
|
||||
{
|
||||
$this->select = $select;
|
||||
return $this;
|
||||
}
|
||||
public function getSelect(): Select
|
||||
{
|
||||
return $this->select;
|
||||
}
|
||||
|
||||
public function build(): string
|
||||
{
|
||||
$query = ["INSERT INTO"];
|
||||
$query []= $this->getTable();
|
||||
if (isset($this->columns)) {
|
||||
$query []= "({$this->getColumnString()})";
|
||||
}
|
||||
if (isset($this->select)) {
|
||||
$query []= "{$this->getSelect()}";
|
||||
return implode(' ', $query);
|
||||
}
|
||||
$query []= 'VALUES';
|
||||
$query []= "({$this->getValueString()})";
|
||||
return implode(' ', $query);
|
||||
}
|
||||
}
|
222
src/Alias/Database/Query/Select.php
Normal file
222
src/Alias/Database/Query/Select.php
Normal file
@ -0,0 +1,222 @@
|
||||
<?php
|
||||
namespace ProVM\Alias\Database\Query;
|
||||
|
||||
use ProVM\Alias\Database\Query;
|
||||
use ProVM\Concept\Database\Query\Select as SelectInterface;
|
||||
|
||||
abstract class Select extends Query implements SelectInterface
|
||||
{
|
||||
public function select(array $columns = ['*']): SelectInterface
|
||||
{
|
||||
return $this->setColumns($columns);
|
||||
}
|
||||
public function from(string $table): SelectInterface
|
||||
{
|
||||
return $this->setTable($table);
|
||||
}
|
||||
public function joins(array $joins): SelectInterface
|
||||
{
|
||||
return $this->setJoins($joins);
|
||||
}
|
||||
public function where(array $conditions): SelectInterface
|
||||
{
|
||||
return $this->setConditions($conditions);
|
||||
}
|
||||
public function groupBy(array $grouping): SelectInterface
|
||||
{
|
||||
return $this->setGroups($grouping);
|
||||
}
|
||||
public function having(array $having): SelectInterface
|
||||
{
|
||||
return $this->setHaving($having);
|
||||
}
|
||||
public function orderBy(array $ordering): SelectInterface
|
||||
{
|
||||
return $this->setOrders($ordering);
|
||||
}
|
||||
|
||||
protected array $columns;
|
||||
public function setColumns(array $columns): SelectInterface
|
||||
{
|
||||
foreach ($columns as $column) {
|
||||
$col = $column;
|
||||
$alias = null;
|
||||
if (is_array($column)) {
|
||||
$col = $column['column'] ?? $column[0];
|
||||
$alias = $column['alias'] ?? $column[1];
|
||||
}
|
||||
$this->addColumn($column, $alias);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addColumn(string $column, ?string $alias = null): SelectInterface
|
||||
{
|
||||
$a = '';
|
||||
if ($alias !== null) {
|
||||
$a = " AS '{$alias}'";
|
||||
}
|
||||
$this->columns[] = "`{$column}`{$a}";
|
||||
return $this;
|
||||
}
|
||||
public function getColumns(): array
|
||||
{
|
||||
return $this->columns;
|
||||
}
|
||||
public function getColumnString(): string
|
||||
{
|
||||
return implode(', ', $this->getColumns());
|
||||
}
|
||||
protected string $table;
|
||||
public function setTable(string $table, ?string $alias = null): SelectInterface
|
||||
{
|
||||
$table = "`{$table}`";
|
||||
if ($alias !== null) {
|
||||
$table = "{$table} '{$alias}'";
|
||||
}
|
||||
$this->table = $table;
|
||||
return $this;
|
||||
}
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
protected array $joins;
|
||||
public function setJoins(array $joins): SelectInterface
|
||||
{
|
||||
foreach ($joins as $join) {
|
||||
$table = $join['table'] ?? $join[0];
|
||||
$expression = $join['expression'] ?? $join[1];
|
||||
$this->addJoin($table, $expression);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addJoin(string $table, string $expression): SelectInterface
|
||||
{
|
||||
$this->joins []= "{$table} ON {$expression}";
|
||||
return $this;
|
||||
}
|
||||
public function getJoins(): array
|
||||
{
|
||||
return $this->joins;
|
||||
}
|
||||
public function getJoinString(): string
|
||||
{
|
||||
return implode(' ', $this->getJoins());
|
||||
}
|
||||
protected array $conditions;
|
||||
public function setConditions(array $conditions): SelectInterface
|
||||
{
|
||||
foreach ($conditions as $condition) {
|
||||
$this->addCondition($condition);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addCondition(string $expression): SelectInterface
|
||||
{
|
||||
$this->conditions []= $expression;
|
||||
return $this;
|
||||
}
|
||||
public function getConditions(): array
|
||||
{
|
||||
return $this->conditions;
|
||||
}
|
||||
public function getConditionString(): string
|
||||
{
|
||||
return implode(' ', $this->getConditions());
|
||||
}
|
||||
protected array $groups;
|
||||
public function setGroups(array $groups): SelectInterface
|
||||
{
|
||||
foreach ($groups as $group) {
|
||||
$this->addGroup($group);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addGroup(string $group): SelectInterface
|
||||
{
|
||||
$this->groups []= "`{$group}`";
|
||||
return $this;
|
||||
}
|
||||
public function getGroups(): array
|
||||
{
|
||||
return $this->groups;
|
||||
}
|
||||
public function getGroupString(): string
|
||||
{
|
||||
return implode(', ', $this->getGroups());
|
||||
}
|
||||
protected array $having;
|
||||
public function setHaving(array $having): SelectInterface
|
||||
{
|
||||
foreach ($having as $item) {
|
||||
$this->addHaving($item);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addHaving(string $having): SelectInterface
|
||||
{
|
||||
$this->having []= $having;
|
||||
return $this;
|
||||
}
|
||||
public function getHaving(): array
|
||||
{
|
||||
return $this->having;
|
||||
}
|
||||
public function getHavingString(): string
|
||||
{
|
||||
return implode(', ', $this->getHaving());
|
||||
}
|
||||
protected array $orders;
|
||||
public function setOrders(array $orders): SelectInterface
|
||||
{
|
||||
foreach ($orders as $order) {
|
||||
$column = $order;
|
||||
$direction = null;
|
||||
if (is_array($order)) {
|
||||
$direction = $order['direction'] ?? $order[1];
|
||||
$column = $order['column'] ?? $order[0];
|
||||
}
|
||||
$this->addOrder($column, $direction);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addOrder(string $column, ?string $direction = null): SelectInterface
|
||||
{
|
||||
if ($direction === null) {
|
||||
$direction = 'ASC';
|
||||
}
|
||||
$this->orders []= "{$column} {$direction}";
|
||||
return $this;
|
||||
}
|
||||
public function getOrders(): array
|
||||
{
|
||||
return $this->orders;
|
||||
}
|
||||
public function getOrderString(): string
|
||||
{
|
||||
return implode(', ', $this->getOrders());
|
||||
}
|
||||
|
||||
public function build(): string
|
||||
{
|
||||
$query = ["SELECT"];
|
||||
$query []= $this->getColumnString();
|
||||
$query []= "FROM {$this->getTable()}";
|
||||
if (isset($this->joins)) {
|
||||
$query []= $this->getJoinString();
|
||||
}
|
||||
if (isset($this->conditions)) {
|
||||
$query []= "WHERE {$this->getConditionString()}";
|
||||
}
|
||||
if (isset($this->groups)) {
|
||||
$query []= "GROUP BY {$this->getGroupString()}";
|
||||
}
|
||||
if (isset($this->having)) {
|
||||
$query []= "HAVING {$this->getHavingString()}";
|
||||
}
|
||||
if (isset($this->orders)) {
|
||||
$query []= "ORDER BY {$this->getOrderString()}";
|
||||
}
|
||||
return implode(' ', $query);
|
||||
}
|
||||
}
|
91
src/Alias/Database/Query/Update.php
Normal file
91
src/Alias/Database/Query/Update.php
Normal file
@ -0,0 +1,91 @@
|
||||
<?php
|
||||
namespace ProVM\Alias\Database\Query;
|
||||
|
||||
use ProVM\Alias\Database\Query;
|
||||
use ProVM\Concept\Database\Query\Update as UpdateInterface;
|
||||
|
||||
abstract class Update extends Query implements UpdateInterface
|
||||
{
|
||||
public function table(string $table): UpdateInterface
|
||||
{
|
||||
return $this->setTable($table);
|
||||
}
|
||||
public function set(array $value_pairs): UpdateInterface
|
||||
{
|
||||
return $this->setValues($value_pairs);
|
||||
}
|
||||
public function where(array $conditions): UpdateInterface
|
||||
{
|
||||
return $this->setConditions($conditions);
|
||||
}
|
||||
|
||||
protected string $table;
|
||||
public function setTable(string $table): UpdateInterface
|
||||
{
|
||||
$this->table = $table;
|
||||
return $this;
|
||||
}
|
||||
public function getTable(): string
|
||||
{
|
||||
return $this->table;
|
||||
}
|
||||
protected array $values;
|
||||
public function setValues(array $values): UpdateInterface
|
||||
{
|
||||
foreach ($values as $value) {
|
||||
$column = $value['column'] ?? $value[0];
|
||||
$val = $value['value'] ?? $value[1];
|
||||
$this->addValue($column, $val);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addValue(string $column, int|string $value): UpdateInterface
|
||||
{
|
||||
if (!is_numeric($value)) {
|
||||
$value = "'{$value}'";
|
||||
}
|
||||
$this->values []= "`{$column}` = {$value}";
|
||||
return $this;
|
||||
}
|
||||
public function getValues(): array
|
||||
{
|
||||
return $this->values;
|
||||
}
|
||||
public function getValueString(): string
|
||||
{
|
||||
return implode(', ', $this->getValues());
|
||||
}
|
||||
protected array $conditions;
|
||||
public function setConditions(array $conditions): UpdateInterface
|
||||
{
|
||||
foreach ($conditions as $condition) {
|
||||
$this->addCondition($condition);
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
public function addCondition(string $expression): UpdateInterface
|
||||
{
|
||||
$this->conditions []= $expression;
|
||||
return $this;
|
||||
}
|
||||
public function getConditions(): array
|
||||
{
|
||||
return $this->conditions;
|
||||
}
|
||||
public function getConditionString(): string
|
||||
{
|
||||
return implode(' ', $this->getConditions());
|
||||
}
|
||||
|
||||
public function build(): string
|
||||
{
|
||||
return implode(' ', [
|
||||
'UPDATE',
|
||||
$this->getTable(),
|
||||
'SET',
|
||||
$this->getValueString(),
|
||||
'WHERE',
|
||||
$this->getConditionString()
|
||||
]);
|
||||
}
|
||||
}
|
8
src/Concept/Database/Query.php
Normal file
8
src/Concept/Database/Query.php
Normal file
@ -0,0 +1,8 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database;
|
||||
|
||||
interface Query
|
||||
{
|
||||
public function build(): string;
|
||||
public function __toString(): string;
|
||||
}
|
10
src/Concept/Database/Query/Delete.php
Normal file
10
src/Concept/Database/Query/Delete.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database\Query;
|
||||
|
||||
use ProVM\Concept\Database\Query;
|
||||
|
||||
interface Delete extends Query
|
||||
{
|
||||
public function from(string $table): Delete;
|
||||
public function where(array $conditions): Delete;
|
||||
}
|
12
src/Concept/Database/Query/Insert.php
Normal file
12
src/Concept/Database/Query/Insert.php
Normal file
@ -0,0 +1,12 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database\Query;
|
||||
|
||||
use ProVM\Concept\Database\Query;
|
||||
|
||||
interface Insert extends Query
|
||||
{
|
||||
public function into(string $table): Insert;
|
||||
public function columns(array $columns): Insert;
|
||||
public function values(array $values): Insert;
|
||||
public function select(Select $select): Insert;
|
||||
}
|
15
src/Concept/Database/Query/Select.php
Normal file
15
src/Concept/Database/Query/Select.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database\Query;
|
||||
|
||||
use ProVM\Concept\Database\Query;
|
||||
|
||||
interface Select extends Query
|
||||
{
|
||||
public function select(array $columns = ['*']): Select;
|
||||
public function from(string $table): Select;
|
||||
public function joins(array $joins): Select;
|
||||
public function where(array $conditions): Select;
|
||||
public function groupBy(array $grouping): Select;
|
||||
public function having(array $having): Select;
|
||||
public function orderBy(array $ordering): Select;
|
||||
}
|
11
src/Concept/Database/Query/Update.php
Normal file
11
src/Concept/Database/Query/Update.php
Normal file
@ -0,0 +1,11 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database\Query;
|
||||
|
||||
use ProVM\Concept\Database\Query;
|
||||
|
||||
interface Update extends Query
|
||||
{
|
||||
public function table(string $table): Update;
|
||||
public function set(array $value_pairs): Update;
|
||||
public function where(array $conditions): Update;
|
||||
}
|
15
src/Concept/Database/QueryBuilder.php
Normal file
15
src/Concept/Database/QueryBuilder.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
namespace ProVM\Concept\Database;
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use ProVM\Concept\Database\Query\{Delete,Insert,Select,Update};
|
||||
|
||||
interface QueryBuilder
|
||||
{
|
||||
public function setContainer(ContainerInterface $container): QueryBuilder;
|
||||
public function getContainer(): ContainerInterface;
|
||||
public function select(array $columns = ['*']): Select;
|
||||
public function insert(string $table): Insert;
|
||||
public function update(string $table): Update;
|
||||
public function delete(string $table): Delete;
|
||||
}
|
7
src/Database/Query/MySQL/Delete.php
Normal file
7
src/Database/Query/MySQL/Delete.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
namespace ProVM\Database\Query\MySQL;
|
||||
|
||||
use ProVM\Alias\Database\Query\Delete as Base;
|
||||
|
||||
class Delete extends Base
|
||||
{}
|
7
src/Database/Query/MySQL/Insert.php
Normal file
7
src/Database/Query/MySQL/Insert.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
namespace ProVM\Database\Query\MySQL;
|
||||
|
||||
use ProVM\Alias\Database\Query\Insert as Base;
|
||||
|
||||
class Insert extends Base
|
||||
{}
|
50
src/Database/Query/MySQL/Select.php
Normal file
50
src/Database/Query/MySQL/Select.php
Normal file
@ -0,0 +1,50 @@
|
||||
<?php
|
||||
namespace ProVM\Database\Query\MySQL;
|
||||
|
||||
use ProVM\Alias\Database\Query\Select as Base;
|
||||
|
||||
class Select extends Base
|
||||
{
|
||||
public function limit(int $limit, ?int $offset = null): Select
|
||||
{
|
||||
$this->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);
|
||||
}
|
||||
}
|
7
src/Database/Query/MySQL/Update.php
Normal file
7
src/Database/Query/MySQL/Update.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
namespace ProVM\Database\Query\MySQL;
|
||||
|
||||
use ProVM\Alias\Database\Query\Update as Base;
|
||||
|
||||
class Update extends Base
|
||||
{}
|
37
src/Database/QueryBuilder.php
Normal file
37
src/Database/QueryBuilder.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
namespace ProVM\Database;
|
||||
|
||||
use Psr\Container\ContainerInterface;
|
||||
use ProVM\Concept\Database\QueryBuilder as QBInterface;
|
||||
use ProVM\Concept\Database\Query\{Delete,Insert,Select,Update};
|
||||
|
||||
class QueryBuilder implements QBInterface
|
||||
{
|
||||
protected ContainerInterface $container;
|
||||
public function setContainer(ContainerInterface $container): QBInterface
|
||||
{
|
||||
$this->container = $container;
|
||||
return $this;
|
||||
}
|
||||
public function getContainer(): ContainerInterface
|
||||
{
|
||||
return $this->container;
|
||||
}
|
||||
|
||||
public function select(array $columns = ['*']): Select
|
||||
{
|
||||
return $this->getContainer()->get(Select::class)->select($columns);
|
||||
}
|
||||
public function insert(string $table): Insert
|
||||
{
|
||||
return $this->getContainer()->get(Insert::class)->into($table);
|
||||
}
|
||||
public function update(string $table): Update
|
||||
{
|
||||
return $this->getContainer()->get(Update::class)->table($table);
|
||||
}
|
||||
public function delete(string $table): Delete
|
||||
{
|
||||
return $this->getContainer()->get(Delete::class)->from($table);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user