Guest User

Untitled

a guest
Jul 12th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. <?php
  2. private function get_query_articles_accueil($count) {
  3. return Doctrine_Query::create()
  4. ->from('Article as a')
  5. ->innerJoin('a.section as s')
  6. ->where('s.section_id =?', array($this->id))
  7. ->andWhere("a.type = 'article'")
  8. ->andWhere("a.visibilite IN ('prive', 'public')")
  9. ->orderBy('date_publication DESC, updated_at DESC')
  10.  
  11. }
  12.  
  13. public function count_articles_accueil() {
  14. return $this->get_query_articles_accueil()->count();
  15. }
  16.  
  17. public function get_articles_accueil($count = 2) {
  18. return $this->get_query_articles_accueil()->limit($count)->execute();
  19. }
Add Comment
Please, Sign In to add comment