]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/OpenID/User_openid.php
c24a1ee9a411cb9a7bc30c01ce3acd7926f2676f
[quix0rs-gnu-social.git] / plugins / OpenID / User_openid.php
1 <?php
2 /**
3  * Table Definition for user_openid
4  */
5 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
6
7 class User_openid extends Memcached_DataObject
8 {
9     ###START_AUTOCODE
10     /* the code below is auto generated do not remove the above tag */
11
12     public $__table = 'user_openid';                     // table name
13     public $canonical;                       // varchar(255)  primary_key not_null
14     public $display;                         // varchar(255)  unique_key not_null
15     public $user_id;                         // int(4)   not_null
16     public $created;                         // datetime()   not_null
17     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
18
19     /* Static get */
20     function staticGet($k,$v=null)
21     { return Memcached_DataObject::staticGet('User_openid',$k,$v); }
22
23     /* the code above is auto generated do not remove the tag below */
24     ###END_AUTOCODE
25
26     function table() {
27
28         global $_DB_DATAOBJECT;
29         $dbtype = $_DB_DATAOBJECT['CONNECTIONS'][$this->_database_dsn_md5]->dsn['phptype'];
30
31         return array('canonical' => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,
32                      'display'   => DB_DATAOBJECT_STR + DB_DATAOBJECT_NOTNULL,
33                      'user_id'   => DB_DATAOBJECT_INT + DB_DATAOBJECT_NOTNULL,
34                      'created'   => DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME + DB_DATAOBJECT_NOTNULL,
35                      'modified'  => ($dbtype == 'mysql') ?
36                      DB_DATAOBJECT_MYSQLTIMESTAMP :
37                      DB_DATAOBJECT_STR + DB_DATAOBJECT_DATE + DB_DATAOBJECT_TIME
38                      );
39     }
40
41     function keys() {
42         return array('canonical' => 'K', 'display' => 'U');
43     }
44
45     static function hasOpenID($user_id)
46     {
47         $oid = new User_openid();
48
49         $oid->user_id = $user_id;
50
51         $cnt = $oid->find();
52
53         return ($cnt > 0);
54     }
55 }