summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorzach <zach@controlyourself.ca>2008-11-16 21:46:24 -0500
committerzach <zach@controlyourself.ca>2008-11-16 21:46:24 -0500
commit41b8c91c6b4f37c61983d0f8f94877bfcd0eb6d2 (patch)
tree5b11661415b4243a52e3b42e1adec86970a9454f /classes
parentfed15bd6b7bcbca6d4707dc4ccedd8784fcadfb2 (diff)
trac685 Twitter bridge - Sync Twitter friends
darcs-hash:20081117024624-462f3-91f148111c2c43ddd302fc63cfa8c8ef14e1f38e.gz
Diffstat (limited to 'classes')
-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;