mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-04 20:58:13 +08:00
Fixed MorphTo Model class namespace
This commit is contained in:
parent
c191287c54
commit
b776ca8fc2
@ -275,7 +275,7 @@ class ModelUpdateVisitor extends NodeVisitorAbstract
|
||||
if (array_key_exists($name, self::RELATION_METHODS)) {
|
||||
if ($name === 'morphTo') {
|
||||
// Model isn't specified because relation is polymorphic
|
||||
$this->setProperty($method->getName(), [Model::class], true);
|
||||
$this->setProperty($method->getName(), ['\\' . Model::class], true);
|
||||
}
|
||||
else if ($expr->args[0]->value instanceof Node\Expr\ClassConstFetch) {
|
||||
$related = $expr->args[0]->value->class->toCodeString();
|
||||
|
Loading…
Reference in New Issue
Block a user