3 * Table Definition for foreign_link
5 require_once INSTALLDIR.'/classes/Memcached_DataObject.php';
7 class Foreign_link extends Memcached_DataObject
10 /* the code below is auto generated do not remove the above tag */
12 public $__table = 'foreign_link'; // table name
13 public $user_id; // int(4) primary_key not_null
14 public $foreign_id; // int(4) primary_key not_null
15 public $service; // int(4) primary_key not_null
16 public $credentials; // varchar(255)
17 public $noticesync; // tinyint(1) not_null default_1
18 public $friendsync; // tinyint(1) not_null default_2
19 public $profilesync; // tinyint(1) not_null default_1
20 public $created; // datetime() not_null
21 public $modified; // timestamp() not_null default_CURRENT_TIMESTAMP
24 function staticGet($k,$v=null)
25 { return Memcached_DataObject::staticGet('Foreign_link',$k,$v); }
27 /* the code above is auto generated do not remove the tag below */
30 // XXX: This only returns a 1->1 single obj mapping. Change? Or make
31 // a getForeignUsers() that returns more than one? --Zach
32 static function getByUserID($user_id, $service) {
33 $flink = new Foreign_link();
34 $flink->service = $service;
35 $flink->user_id = $user_id;
38 if ($flink->find(true)) {
45 static function getByForeignID($foreign_id, $service) {
46 $flink = new Foreign_link();
47 $flink->service = $service;
48 $flink->foreign_id = $foreign_id;
51 if ($flink->find(true)) {
59 function getForeignUser()
61 $fuser = new Foreign_user();
62 $fuser->service = $this->service;
63 $fuser->id = $this->foreign_id;
67 if ($fuser->find(true)) {
76 return User::staticGet($this->user_id);