symfony或doctrine报错:Object of class AppEntity* could not be converted to string

217次阅读
一条评论

报错:

Catchable Fatal Error: Object of class AppEntityProjectType could not be converted to string

版本:symfony5.0

解决办法:

在对应のEntity里添加public __toString方法,我这里就是AppEntityProjectType类

// AppEntityProjectType 
    public function __toString(){
        return strval($this->getId());
    }

具体原因:可以  > 看这里 <    |    > 这里 <

facingscreen
版权声明:本站原创文章,由 facingscreen2022-08-12发表,共计261字。
转载说明:本文为搜栈网原创文章,除特殊说明外皆由CC-4.0协议发布,转载请注明出处,如有帮助欢迎打赏。
评论(一条评论)
验证码
Spain Euro 2024 评论达人 LV.1
2024-07-21 11:54:20 回复

babymonster

Go-http-clientGo-http-client1.1