2023-02-28 23:47:02 -03:00
|
|
|
<?php
|
2025-09-29 16:40:43 -03:00
|
|
|
namespace Database\Reinforce\Query;
|
2023-02-28 23:47:02 -03:00
|
|
|
|
|
|
|
trait hasTable
|
|
|
|
{
|
|
|
|
protected string $table;
|
|
|
|
|
|
|
|
public function getTable(): string
|
|
|
|
{
|
|
|
|
return $this->table;
|
|
|
|
}
|
|
|
|
|
2024-08-03 20:58:53 -04:00
|
|
|
public function setTable(string $table, ?string $alias = null): self
|
2023-02-28 23:47:02 -03:00
|
|
|
{
|
|
|
|
if ($alias !== null) {
|
|
|
|
$table = "{$table} '{$alias}'";
|
|
|
|
}
|
|
|
|
$this->table = $table;
|
|
|
|
return $this;
|
|
|
|
}
|
|
|
|
}
|