저는 제품과 색상 사이에 많은 관계가 있습니다.Doctrine Entity findBy Many to Many
내가하려는 일은 색상별로 제품을 찾는 것입니다.
예)
$colours = $em->getRepository('Xxxxx\XxxxxBundle\Entity\Colour')->findBy(array('name'=>'red');
$products = $em->getRepository('Xxxxx\XxxxxBundle\Entity\Product')->findBy(array('colours'=>$colours));
이 내 YAML의 설정입니다 :
Xxxxx\XxxxxBundle\Entity\Product:
type: entity
manyToMany:
colours:
targetEntity: Colour
joinTable:
name: Product_Colour
joinColumns:
product_id:
referencedColumnName: id
inverseJoinColumns:
colour_id:
referencedColumnName: id
.
Xxxxx\XxxxxBundle\Entity\Colour:
type: entity
id:
id:
type: integer
generator:
strategy: AUTO
fields:
hex:
type: string
length: 320
name:
type: string
length: 320
내가 무엇입니까 오류 메시지는 다음과 같습니다
Notice: Undefined index: joinColumns in /home/xxx/public_html/products/vendor/doctrine/lib/Doctrine/ORM/Persisters/BasicEntityPersister.php line 1217
누군가는 왜 작동하지 않습니다에 대한 몇 가지 빛을 할 수있을 것입니다.