add static method to get inherited class querybuilder from model, add isset method in model
This commit is contained in:
@@ -121,6 +121,21 @@ class Model
|
||||
}
|
||||
}
|
||||
|
||||
public function __isset($name): bool
|
||||
{
|
||||
if (method_exists($this, $name)) {
|
||||
return true;
|
||||
} else {
|
||||
return isset($this->values[$name]);
|
||||
}
|
||||
}
|
||||
|
||||
public static function q(): QueryBuilder
|
||||
{
|
||||
$ist = new static();
|
||||
return $ist->newQueryBuilder();
|
||||
}
|
||||
|
||||
public function __get($name): mixed
|
||||
{
|
||||
if (isset($this->values[$name])) {
|
||||
|
||||
Reference in New Issue
Block a user