23 lines
427 B
PHP
23 lines
427 B
PHP
|
<?php
|
||
|
namespace ProVM\Implement\Database\Query;
|
||
|
|
||
|
trait hasTable
|
||
|
{
|
||
|
protected string $table;
|
||
|
|
||
|
public function getTable(): string
|
||
|
{
|
||
|
return $this->table;
|
||
|
}
|
||
|
|
||
|
public function setTable(string $table, ?string $alias = null)
|
||
|
{
|
||
|
$table = "`{$table}`";
|
||
|
if ($alias !== null) {
|
||
|
$table = "{$table} '{$alias}'";
|
||
|
}
|
||
|
$this->table = $table;
|
||
|
return $this;
|
||
|
}
|
||
|
}
|