变更
This commit is contained in:
@@ -110,6 +110,17 @@ class ActiveQuery extends Component implements ISqlBuilder
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param bool $asArray
|
||||
* @return static
|
||||
*/
|
||||
public function asArray(bool $asArray = true): static
|
||||
{
|
||||
$this->asArray = $asArray;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param array $values
|
||||
* @return $this
|
||||
|
||||
+3
-6
@@ -45,7 +45,6 @@ abstract class HasBase implements \Database\Traits\Relation
|
||||
*/
|
||||
public function __construct(public string $name)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -55,13 +54,11 @@ abstract class HasBase implements \Database\Traits\Relation
|
||||
*/
|
||||
public function __call($name, $arguments)
|
||||
{
|
||||
if (!method_exists($this, $name)) {
|
||||
$relation = Kiri::getDi()->get(Relation::class);
|
||||
$relation->getQuery($this->name)->$name(...$arguments);
|
||||
if ($name !== 'get') {
|
||||
return di(Relation::class)->getQuery($this->name)->$name(...$arguments);
|
||||
} else {
|
||||
call_user_func([$this, $name], ...$arguments);
|
||||
return $this->get();
|
||||
}
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user