summaryrefslogtreecommitdiff
path: root/classes/Foreign_link.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Foreign_link.php')
-rw-r--r--classes/Foreign_link.php18
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;
+ }
+
}