From: Vincent Wasteels <vincent.waste...@gmail.com>
Date: Fri, 9 Nov 2012 09:40:49 -0500
Local: Fri, Nov 9 2012 9:40 am
Subject: Re: [doctrine-user] Re: ManytoMany Join with foreign table and Association Filtering Criteria
it gives me the join table , that's my problem ...
2012/11/8 Gregory McLean <cent...@gmail.com>
> On 11/08/2012 05:28 PM, Vincent Wasteels wrote:
> > Hello, thx for ur answer !! > > I'm using a third table for the relation and some extra fields , so I
> > I can access : $this->categoryArticle , but the attribute I have to
> So $this->categoryArticle() gives you your article entity or the
> > I'm stuck on this ... !
> > thanks for ur help !! much appreciated !
> > Le jeudi 8 novembre 2012 16:33:40 UTC-5, Gregory McLean a écrit :
> >> In your category entity use the collection criteria, and something like
> >> public function getRelatedArticles($start = 0, $limit = 10)
> >> return $this->articles->matching($criteria);
> >> Then in the article entity add the @OrderBy annotation on the manytomany
> >> @ManyToMany(<blah blah blah>)
> >> Then it _should_ do what you want when in the template you do
> >> {% for related in article.category.relatedarticles %}
> >> This of course is if I'm understanding how you have all the entities
> >> On Thursday, November 8, 2012 11:52:41 AM UTC-5, Vincent Wasteels wrote:
> >>> Hello doctrine !!
> >>> I have a model like this :
> >>> Article 1.* ArticleCategory *.1 Category
> >>> In my Category Entity, I want to get all article related to $this ,
> >>> I could do :
> >>> $articles = array();
> >>> But It won't deal the orderBy, and it seems too heavy anyway...
> >>> The Criteria from Doctrine Collection is more appropriated but I don't
> >>> and I don't want to do this in a repository since it concerns a
> >>> Any hints for me ?
> >>> thanks !!
> --
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||