]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/Oauth_application_user.php
Decided we didn't need to keep the token secret in the
[quix0rs-gnu-social.git] / classes / Oauth_application_user.php
1 <?php
2 /**
3  * Table Definition for oauth_application_user
4  */
5 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
6
7 class Oauth_application_user extends Memcached_DataObject
8 {
9     ###START_AUTOCODE
10     /* the code below is auto generated do not remove the above tag */
11
12     public $__table = 'oauth_application_user';          // table name
13     public $profile_id;                      // int(4)  primary_key not_null
14     public $application_id;                  // int(4)  primary_key not_null
15     public $access_type;                     // tinyint(1)
16     public $token;                           // varchar(255)
17     public $verifier;                        // varchar(255)
18     public $created;                         // datetime   not_null
19     public $modified;                        // timestamp   not_null default_CURRENT_TIMESTAMP
20
21     /* Static get */
22     function staticGet($k,$v=NULL) {
23         return Memcached_DataObject::staticGet('Oauth_application_user',$k,$v);
24     }
25     /* the code above is auto generated do not remove the tag below */
26     ###END_AUTOCODE
27
28     static function getByKeys($user, $app)
29     {
30         if (empty($user) || empty($app)) {
31             return null;
32         }
33
34         $oau = new Oauth_application_user();
35
36         $oau->profile_id     = $user->id;
37         $oau->application_id = $app->id;
38         $oau->limit(1);
39
40         $result = $oau->find(true);
41
42         return empty($result) ? null : $oau;
43     }
44
45 }