Fix Model and Manager
This commit is contained in:
parent
a3a555a116
commit
f165e9fc00
2 changed files with 13 additions and 5 deletions
|
@ -58,9 +58,15 @@ class Manager
|
|||
*/
|
||||
public function __get(string $name) /* : mixed */
|
||||
{
|
||||
$key = $this->cKey . '/' . $name;
|
||||
$x = \ord($name);
|
||||
|
||||
return $this->c->$key->setManager($this);
|
||||
if ($x > 90 || $x < 65) {
|
||||
return null;
|
||||
} else {
|
||||
$key = $this->cKey . '/' . \lcfirst($name);
|
||||
|
||||
return $this->c->$key->setManager($this);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -68,6 +74,8 @@ class Manager
|
|||
*/
|
||||
public function __call(string $name, array $args) /* : mixed */
|
||||
{
|
||||
return $this->__get($name)->$name(...$args);
|
||||
$key = $this->cKey . '/' . $name;
|
||||
|
||||
return $this->c->$key->setManager($this)->$name(...$args);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -143,9 +143,9 @@ class Model
|
|||
if ($x > 90 || $x < 65) {
|
||||
return null;
|
||||
} else {
|
||||
$key = \str_replace(['ForkBB\\Models\\', 'ForkBB\\', '\\'], '', \get_class($this));
|
||||
$key = $this->cKey . '/' . \lcfirst($name);
|
||||
|
||||
return $this->c->{$key . $name}->setModel($this);
|
||||
return $this->c->$key->setModel($this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue