在 b/w 2 实体(产品和报价)中实现多对多关系时出现以下错误:
可捕获的致命错误:FoodBundle\Entity\Product 类的对象无法转换为字符串
其中 Product 实体与 Offer 实体相关。我的目标是利用多对多关系的产品报价。
正如我从错误中猜测的那样,这段代码正在创建它。
class Offer
{
public function addProduct(\FoodBundle\Entity\Product $product)
{
$this->product[] = $product;
return $this;
}
}
请帮我解决这个问题。