]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/OpenID/classes/User_openid.php
plugins onAutoload now only overloads if necessary (extlibs etc.)
[quix0rs-gnu-social.git] / plugins / OpenID / classes / User_openid.php
1 <?php
2 /**
3  * Table Definition for user_openid
4  */
5
6 if (!defined('STATUSNET')) {
7     exit(1);
8 }
9
10 class User_openid extends Managed_DataObject
11 {
12     ###START_AUTOCODE
13     /* the code below is auto generated do not remove the above tag */
14
15     public $__table = 'user_openid';                     // table name
16     public $canonical;                       // varchar(255)  primary_key not_null
17     public $display;                         // varchar(255)  unique_key not_null
18     public $user_id;                         // int(4)   not_null
19     public $created;                         // datetime()   not_null
20     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
21
22     /* the code above is auto generated do not remove the tag below */
23     ###END_AUTOCODE
24
25     public static function schemaDef()
26     {
27         return array(
28             'fields' => array(
29                 'canonical' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'OpenID canonical string'),
30                 'display' => array('type' => 'varchar', 'not null' => true, 'length' => 255, 'description' => 'OpenID display string'),
31                 'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'User ID for OpenID owner'),
32                 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
33                 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
34             ),
35             'primary key' => array('canonical'),
36             'unique keys' => array(
37                 'user_openid_display_key' => array('display'),
38             ),
39             'indexes' => array(
40                 'user_openid_user_id_idx' => array('user_id'),
41             ),
42             'foreign keys' => array(
43                 'user_openid_user_id_fkey' => array('user', array('user_id' => 'id')),
44             ),
45         );
46     }
47
48     static function hasOpenID($user_id)
49     {
50         $oid = new User_openid();
51
52         $oid->user_id = $user_id;
53
54         $cnt = $oid->find();
55
56         return ($cnt > 0);
57     }
58 }