3 * Table Definition for user_openid
6 if (!defined('STATUSNET')) {
10 class User_openid extends Managed_DataObject
13 /* the code below is auto generated do not remove the above tag */
15 public $__table = 'user_openid'; // table name
16 public $canonical; // varchar(191) primary_key not_null
17 public $display; // varchar(191) 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
22 /* the code above is auto generated do not remove the tag below */
25 public static function schemaDef()
29 'canonical' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'OpenID canonical string'),
30 'display' => array('type' => 'varchar', 'not null' => true, 'length' => 191, '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'),
35 'primary key' => array('canonical'),
36 'unique keys' => array(
37 'user_openid_display_key' => array('display'),
40 'user_openid_user_id_idx' => array('user_id'),
42 'foreign keys' => array(
43 'user_openid_user_id_fkey' => array('user', array('user_id' => 'id')),
48 public function getID()
50 if (!isset($this->user_id)) {
51 throw new Exception('No ID set.');
52 } elseif (empty($this->user_id)) {
53 throw new Exception('Empty ID for object! (not inserted yet?).');
55 return intval($this->user_id);
58 static function hasOpenID($user_id)
60 $oid = new User_openid();
62 $oid->user_id = $user_id;