root/trunk/lib/model/QuestionPeer.php

Revision 18, 1.4 kB (checked in by fabien, 7 years ago)

day 7 modifications

  • Property svn:mime-type set to text/x-php
  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
Line 
1 <?php
2
3   // include base peer class
4   require_once 'model/om/BaseQuestionPeer.php';
5  
6   // include object class
7   include_once 'model/Question.php';
8
9
10 /**
11  * Skeleton subclass for performing query and update operations on the 'ask_question' table.
12  *
13  *
14  *
15  * You should add additional methods to this class to meet the
16  * application requirements.  This class will only be generated as
17  * long as it does not already exist in the output directory.
18  *
19  * @package model
20  */   
21 class QuestionPeer extends BaseQuestionPeer
22 {
23   public static function getQuestionFromTitle($title)
24   {
25     $c = new Criteria();
26     $c->add(self::STRIPPED_TITLE, $title);
27
28     $questions = self::doSelectJoinUser($c);
29
30     return $questions ? $questions[0] : null;
31   }
32
33   public static function getHomepagePager($page)
34   {
35     $pager = new sfPager('Question', APP_PAGER_HOMEPAGE_MAX);
36     $c = new Criteria();
37     $c->addDescendingOrderByColumn(self::INTERESTED_USERS);
38     $pager->setCriteria($c);
39     $pager->setPage($page);
40     $pager->setPeerMethod('doSelectJoinUser');
41     $pager->init();
42
43     return $pager;
44   }
45
46   public static function getRecentPager($page)
47   {
48     $pager = new sfPager('Question', APP_PAGER_HOMEPAGE_MAX);
49     $c = new Criteria();
50     $c->addDescendingOrderByColumn(self::CREATED_AT);
51     $pager->setCriteria($c);
52     $pager->setPage($page);
53     $pager->setPeerMethod('doSelectJoinUser');
54     $pager->init();
55
56     return $pager;
57   }
58 }
59
60 ?>
Note: See TracBrowser for help on using the browser.