更新时间:2023-11-19 19:03:04
我已解决!
问题出在用户实体的getRoles方法上
The problem was on the getRoles method on User Entity.
之前是这样的:
function getRoles() {
return $this->roles->toArray();
}
我已更改为:
function getRoles()
{
$roles = array();
foreach($this->userRoles as $userRole) {
$roles[] = $userRole->getRole();
}
return $roles;
}
如果有人知道我为什么会升值
If anyone knows why I would appreciate