Good evening,

I've been searching all day for a solution.

i've got a News entity and a Group entity.
News are associated with a many to many relation to the groups.

    table: `News`
>     type: entity
>     id:
>         id:
>             type: integer
>             generator:
>                 strategy: AUTO
>     fields:
>         publishDate:
>             column: `publishDate`
>             type: date
>         title:
>             column: `title`
>             type: string
>     manyToOne:
>         creator:
>             targetEntity: MyBundle\Entity\User
>     manyToMany:
>         groups:
>             targetEntity: MyBundle\Entity\Group


i want to use SQLFilter or any similar to get the news having particular 
groups.
but if i check the SQL request, it never do the join.

SELECT
t0.id AS id1,
t0.`publishDate` AS publishDate2,
t0.`title` AS title3,
t0.creator_id AS creator_id4
FROM
`News` t0

So i can't return a sql clause like *news.groups IN (2)* for exemple.

i know it's a way of doing it that using a custom repository and create a 
getByGroup method
but i need to ensure that anywhere the news are called, they are filtered.
so i'd rather avoid this solution.

Any idea ?
Thank you !
 

-- 
You received this message because you are subscribed to the Google Groups 
"doctrine-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/doctrine-user.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to