2008-06-17 22:35:01 +09:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Table Definition for user_openid
|
|
|
|
*/
|
2010-10-09 03:23:53 +09:00
|
|
|
|
|
|
|
if (!defined('STATUSNET')) {
|
|
|
|
exit(1);
|
|
|
|
}
|
2008-06-17 22:35:01 +09:00
|
|
|
|
2013-08-18 19:10:44 +09:00
|
|
|
class User_openid extends Managed_DataObject
|
2008-06-17 22:35:01 +09:00
|
|
|
{
|
|
|
|
###START_AUTOCODE
|
|
|
|
/* the code below is auto generated do not remove the above tag */
|
|
|
|
|
|
|
|
public $__table = 'user_openid'; // table name
|
2015-02-13 02:18:55 +09:00
|
|
|
public $canonical; // varchar(191) primary_key not_null
|
|
|
|
public $display; // varchar(191) unique_key not_null
|
2008-06-18 20:01:26 +09:00
|
|
|
public $user_id; // int(4) not_null
|
2008-06-17 22:35:01 +09:00
|
|
|
public $created; // datetime() not_null
|
|
|
|
public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
|
|
|
|
|
|
|
|
/* the code above is auto generated do not remove the tag below */
|
|
|
|
###END_AUTOCODE
|
2009-08-05 02:17:43 +09:00
|
|
|
|
2013-08-20 00:08:18 +09:00
|
|
|
public static function schemaDef()
|
2009-11-26 11:21:23 +09:00
|
|
|
{
|
2013-08-20 00:08:18 +09:00
|
|
|
return array(
|
|
|
|
'fields' => array(
|
2015-02-13 02:18:55 +09:00
|
|
|
'canonical' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'OpenID canonical string'),
|
|
|
|
'display' => array('type' => 'varchar', 'not null' => true, 'length' => 191, 'description' => 'OpenID display string'),
|
2013-08-20 00:08:18 +09:00
|
|
|
'user_id' => array('type' => 'int', 'not null' => true, 'description' => 'User ID for OpenID owner'),
|
|
|
|
'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
|
|
|
|
'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
|
|
|
|
),
|
|
|
|
'primary key' => array('canonical'),
|
|
|
|
'unique keys' => array(
|
|
|
|
'user_openid_display_key' => array('display'),
|
|
|
|
),
|
|
|
|
'indexes' => array(
|
|
|
|
'user_openid_user_id_idx' => array('user_id'),
|
|
|
|
),
|
|
|
|
'foreign keys' => array(
|
|
|
|
'user_openid_user_id_fkey' => array('user', array('user_id' => 'id')),
|
|
|
|
),
|
|
|
|
);
|
2009-11-26 08:12:24 +09:00
|
|
|
}
|
|
|
|
|
2011-08-28 06:42:31 +09:00
|
|
|
static function hasOpenID($user_id)
|
2009-08-05 02:17:43 +09:00
|
|
|
{
|
|
|
|
$oid = new User_openid();
|
|
|
|
|
|
|
|
$oid->user_id = $user_id;
|
|
|
|
|
|
|
|
$cnt = $oid->find();
|
|
|
|
|
|
|
|
return ($cnt > 0);
|
|
|
|
}
|
2008-06-17 22:35:01 +09:00
|
|
|
}
|