diff options
author | Zach Copley <zach@controlyourself.ca> | 2008-08-28 03:22:05 -0400 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2008-08-28 03:22:05 -0400 |
commit | bf14709fe2ed18f5a2641f841cb000a4856290fd (patch) | |
tree | 508497b61ec9a4b98e21d27511c0b4928f50c4f1 /classes/Foreign_link.php | |
parent | 8ff52da16927c37462e32b24307dae5bd689fd1a (diff) |
Twitter integration - support for new foreign_link table and prefs now save/update
darcs-hash:20080828072205-7b5ce-16510357343f1d9a3acc696f39a28a723005f3a4.gz
Diffstat (limited to 'classes/Foreign_link.php')
-rw-r--r-- | classes/Foreign_link.php | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php index a93f30f2c..4fcad4b17 100644 --- a/classes/Foreign_link.php +++ b/classes/Foreign_link.php @@ -25,4 +25,22 @@ class Foreign_link extends DB_DataObject /* the code above is auto generated do not remove the tag below */ ###END_AUTOCODE + + // XXX: This only returns a 1->1 single obj mapping. Change? Or make + // a getForeignUsers() that returns more than one? --Zach + static function getForeignLink($user_id, $service) { + + $flink = new Foreign_link(); + $flink->whereAdd("service = $service"); + $flink->whereAdd("user_id = $user_id"); + $flink->limit(1); + + if ($flink->find()) { + $flink->fetch(); + return $flink; + } + + return NULL; + } + } |