私は直接ではなく、2 entites間の多対多の関係をクレタしたいが、二重manyToOne関係で第3のエンティティを使用して動作しません。教義は、第3のエンティティの上に多対多を作成し、適切
AppBundle\Entity\AttributeKey:
type: entity
table: attribute_keys
repositoryClass: AppBundle\Repository\AttributeKeyRepository
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
label:
type: string
length: 255
unique: true
sort:
type: integer
AppBundle\Entity\AttributeValue:
type: entity
table: attribute_values
repositoryClass: AppBundle\Repository\AttributeValueRepository
id:
id:
type: integer
id: true
generator:
strategy: AUTO
fields:
label:
type: string
length: 255
unique: true
AppBundle\Entity\AttributeKeyValue:
type: entity
table: attribute_keys_values
repositoryClass: AppBundle\Repository\AttributeKeyValueRepository
manyToOne:
attributeKey:
targetEntity: AttributeKey
attributeValue:
targetEntity: AttributeValue
manyToMany:
documents:
targetEntity: Document
mappedBy: attributes
id:
id:
type: integer
id: true
generator:
strategy: AUTO
データベースにすべての問題はないようですが、外部キーは正しく構築されています。しかしAttributeKey
教義によって生成されたエンティティはメソッドgetValues()
が含まれていないとAttributeValue
は私が間違って何をしましたgetKeys()
またはaddKey()
方法を持っていませんか?
の神私のああ、私は、おかげで、このようなばか者だったのですそれ – Asara