FriendsOfSymfony/FOSCommentBundle — Issue #108: How can I retrieve comment information joining with my table?
Author: sam57
Created: 2012-01-16 16:05:31+00:00
State: open

Hi,

I retrieve all my entities from the Post table where each media has some comments...

I want to retrieve comment with all my Post, how can I do ?

I have tried to do this, but it doesn't work:

$query = $this->getEntityManager()
->createQuery('
SELECT	P
FROM	NamespaceMyBundle:Post P
LEFT JOIN	Comment C ON C.id=CONCAT('post_',P.id)

GROUP BY	P.id
ORDER BY	P.dEvent DESC, P.dCreated DESC'
)

;

I have this error:
[Semantical Error] line 0, col 96 near 'Com ON C.id=CONCAT("post_",P.id)
WHERE': Error: Identification Variable Comment used in join path expression but was not defined before.

Any idea?

Thanks