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.php20
1 files changed, 18 insertions, 2 deletions
diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php
index 1ba74e74f..e3f7bfdd8 100644
--- a/classes/Foreign_link.php
+++ b/classes/Foreign_link.php
@@ -28,7 +28,7 @@ class Foreign_link extends Memcached_DataObject
// 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) {
+ static function getByUserID($user_id, $service) {
$flink = new Foreign_link();
$flink->service = $service;
$flink->user_id = $user_id;
@@ -41,11 +41,27 @@ class Foreign_link extends Memcached_DataObject
return NULL;
}
+ static function getByForeignID($foreign_id, $service) {
+ $flink = new Foreign_link();
+ $flink->service = $service;
+ $flink->foreign_id = $foreign_id;
+ $flink->limit(1);
+
+ if ($flink->find(TRUE)) {
+ return $flink;
+ }
+
+ return NULL;
+ }
+
+
// Convenience method
function getForeignUser() {
$fuser = new Foreign_user();
-
+
+ common_debug("service = " . $this->service);
+ common_debug("foreign_id = " . $this->foreign_id);
$fuser->service = $this->service;
$fuser->id = $this->foreign_id;