eee
This commit is contained in:
@@ -434,13 +434,15 @@ abstract class QueryTrait extends Component implements ActiveQueryInterface, ISq
|
||||
|
||||
|
||||
/**
|
||||
* @param string|Closure $tableName
|
||||
* @param string|Closure|Query $tableName
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function from(string|Closure $tableName): static
|
||||
public function from(string|Closure|Query $tableName): static
|
||||
{
|
||||
if ($tableName instanceof Closure) {
|
||||
if ($tableName instanceof Query) {
|
||||
$this->from = '(' . $tableName->build() . ')';
|
||||
} else if ($tableName instanceof Closure) {
|
||||
$this->from = '(' . $this->makeClosureFunction($tableName) . ')';
|
||||
} else if (class_exists($tableName)) {
|
||||
$this->from = (new $tableName)->getTable();
|
||||
|
||||
Reference in New Issue
Block a user