root/trunk/lib/model/CompanyPersonPeer.php

Revision 2, 0.8 kB (checked in by nperriault, 10 months ago)

First commit of the extracted code from production, I hope no passwd has been forgotten :-)

Line 
1 <?php
2 /**
3  * Subclass for performing query and update operations on the 'company_people' table.
4  *
5  * @package lib.model
6  */
7 class CompanyPersonPeer extends BaseCompanyPersonPeer
8 {
9
10   public static function retrieveByCompanyIdAndUserId($company_id, $user_id, Criteria $c = null)
11   {
12     if (!$c instanceof Criteria)
13     {
14       $c = new Criteria();
15     }
16     $c->add(self::COMPANY_ID, $company_id);
17     $c->add(self::USER_ID, $user_id);
18     return self::doSelectOne($c);
19   }
20  
21   public static function retrieveForUser($user, Criteria $c = null)
22   {
23     if (!$c instanceof Criteria)
24     {
25       $c = new Criteria();
26     }
27     $c->addJoin(self::COMPANY_ID, CompanyPeer::ID);
28     $c->add(self::USER_ID, $user->getId());
29     $c->addDescendingOrderByColumn(self::STARTED_AT);
30     return self::doSelectJoinAll($c);
31   }
32  
33 }
34
Note: See TracBrowser for help on using the browser.