Wait, actually I didn't realize you were trying to select the latest 10 articles, I thought you were just getting 10 articles from different users. That would make things more difficult. I'm not sure how you'd do that.
On Nov 17, 12:53 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > No it wouldn't. Use this: > > $c = new Criteria(); > $c->addDescendingOrderByColumn(UserPeer::CREATED_AT); > $pager = new sfPropelPager('User', 10); > > and then, when you have 10 user objects in your template, > > <?php $user->getLatestArticle()->printArticle() ?> > > What you're really trying to do is retrieve a list of users, and then > get an article from each of them. > > -Brendan > > On Nov 17, 12:44 pm, javo <[EMAIL PROTECTED]> wrote: > > > That would select the latest articles from one user, wouldn't it? > > > I want to select 10 articles (latest) from different users :) > > > On Nov 17, 5:39 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > > > > Why not just get users with criteria and write a $user- > > > > >getLatestArticle() method that's called in your view? > > > > On Nov 17, 12:28 pm, javo <[EMAIL PROTECTED]> wrote: > > > > > Hi, > > > > > I use this code to display articles on my page, > > > > > public function executeIndex() > > > > { > > > > > $c = new Criteria(); > > > > $c->addDescendingOrderByColumn(ArticlePeer::CREATED_AT); > > > > $pager = new sfPropelPager('Article', 10); > > > > $pager->setPeerMethod('doSelectJoinSfGuardUserProfile'); > > > > $pager->setCriteria($c); > > > > > $pager->setPage($this->getRequestParameter('page', 1)); > > > > $pager->init(); > > > > $this->pager = $pager; > > > > > } > > > > > It list 10 articles, it's all fine but is there any way to display > > > > only one article from one author? so the SfGuardUserProfileId would be > > > > unique? > > > > > Thank you --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to symfony-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---