主义“关系不存在”错误

问题描述:

我有两个由公司供应商实体链接在一起的主体实体(公司和供应商)。实体和YAML资源情况如下:主义“关系不存在”错误

class Company 
{ 
    /** 
    * @var integer 
    */ 
    private $id; 

    /** 
    * @var string 
    */ 
    private $name; 

} 

class Supplier 
{ 
    /** 
    * @var integer 
    */ 
    private $id; 

    /** 
    * @var string 
    */ 
    private $name; 

}  

class CompanySupplier 
{ 
    /** 
    * @var integer 
    */ 
    private $id; 

    /** 
    * @var integer 
    */ 
    private $company_id; 

    /** 
    * @var integer 
    */ 
    private $supplier_id; 

} 

我的资源如下:

AppBundle\Entity\Company: 
    type: entity 
    table: companies 
    id: 
    id: 
     type: integer 
    fields: 
    name: 
     type: string 
    manyToMany: 
    Suppliers: 
     targetEntity: Supplier 
     joinTable: 
     name: company_suppliers 
     joinColumns: 
      company_id: 
      referencedColumnName: id 
     inverseJoinColumns: 
      supplier_id: 
      referencedColumnName: id 


AppBundle\Entity\Supplier: 
    type: entity 
    table: suppliers 
    id: 
    id: 
     type: integer 
    fields: 
    name: 
     type: string 

AppBundle\Entity\CompanySupplier: 
    type: entity 
    table: company_suppliers 
    id: 
    id: 
     type: integer 
    fields: 
    company_id: 
     type: integer 
    supplier_id: 
     type: integer 
    ManyToMany: 
    Supplier: 
     targetEntity: Supplier 
     joinColumn: 
     name: id 
     referencedColumnName: supplier_id 

的问题是,这似乎引起“关系company_supplier不存在”的错误,我看不到如何解决。我需要做些什么来设置关系,以便它们起作用?

它可以工作,如果我没有公司供应商实体和资源,但只要我定义这些错误开始出现。

我很感激任何指针,这让我很生气。

做更改命名空间和你不需要写关系表,我认为 see here

Company: 
    type: entity 
    manyToMany: 
    supplier: 
     targetEntity: CompanySupplier 
     inversedBy: company 
     joinTable: 
     name: company_suppliers 
     joinColumns: 
      name: id 
      referencedColumnName: supplier_id 
     inverseJoinColumns: 
      supplier_id: 
      referencedColumnName: id 

Supplier: 
    type: entity 
    manyToMany: 
    company: 
     targetEntity: Company 
     mappedBy: supplier