]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - classes/Foreign_user.php
25a6ac979fcbecc0fdb0a0c6d14407c7220a4306
[quix0rs-gnu-social.git] / classes / Foreign_user.php
1 <?php
2 /**
3  * Table Definition for foreign_user
4  */
5 require_once 'DB/DataObject.php';
6
7 class Foreign_user extends DB_DataObject 
8 {
9     ###START_AUTOCODE
10     /* the code below is auto generated do not remove the above tag */
11
12     public $__table = 'foreign_user';                    // table name
13     public $id;                              // int(4)  primary_key not_null
14     public $service;                         // int(4)  primary_key not_null
15     public $uri;                             // varchar(255)  unique_key not_null
16     public $nickname;                        // varchar(255)  
17     public $created;                         // datetime()   not_null
18     public $modified;                        // timestamp()   not_null default_CURRENT_TIMESTAMP
19
20     /* Static get */
21     function staticGet($k,$v=NULL) { return DB_DataObject::staticGet('Foreign_user',$k,$v); }
22
23     /* the code above is auto generated do not remove the tag below */
24     ###END_AUTOCODE
25         
26         static function save($fields) {
27                 
28                 extract($fields);
29                                 
30                 $fuser = new Foreign_user();
31                 
32                 $fuser->id = $id;
33                 $fuser->service = $service;
34                 $fuser->uri = $uri;
35                 $fuser->nickname = $nickname;           
36                 $fuser->user_id = $user_id;
37                 $fuser->credentials = $credentials;
38                 $fuser->created = common_sql_now();
39                 
40                 $result = $fuser->insert();
41
42                 if (!$result) {
43                         common_log_db_error($fuser, 'INSERT', __FILE__);
44                         return FALSE;
45                 }
46
47                 return $fuser;
48         }
49         
50 }