I've this DQL request in my PageRepository :
SELECT p, b
FROM CmsCmsBundle:Page p
JOIN b.page p
WHERE p.position = :position
And this error message appear :
[Semantical Error] line 0, col 51 near '.page p WHERE': Error: Identification Variable b used in join path expression but was not defined before.
I have 2 entities (page and block) with bidirectionnal relation like this :
/**
* (Block.php (without "s" )
* @ORM\ManyToOne(targetEntity="Cms\CmsBundle\Entity\Page", inversedBy="blocks")
* @ORM\JoinColumn(nullable=false)
* @Assert\Valid()
*/
private $page;
/**
* (page.php)
* @ORM\OneToMany(targetEntity="Cms\CmsBundle\Entity\Block", mappedBy="page", cascade={"persist"})
* @ORM\JoinColumn(nullable=false)
* @Assert\Valid()
*/
protected $blocks;
Some idea ?
Problem solved, I've just inversed "b.page p" instead of "p.blocks b"