summaryrefslogtreecommitdiff
path: root/classes/Foreign_link.php
diff options
context:
space:
mode:
authorZach Copley <zach@controlyourself.ca>2008-08-28 15:25:09 -0400
committerZach Copley <zach@controlyourself.ca>2008-08-28 15:25:09 -0400
commit412eae10fe81c6493f3ca5e05d7365839045f54e (patch)
tree74dabbb164a1ed6fe0fb33c5c154a7c2895765a0 /classes/Foreign_link.php
parentbf14709fe2ed18f5a2641f841cb000a4856290fd (diff)
Twitter integration - Notices now broadcast (directly) to Twitter from linked accts.
darcs-hash:20080828192509-7b5ce-8387c67500c082eb5a0107c0f78d4cf5620825af.gz
Diffstat (limited to 'classes/Foreign_link.php')
-rw-r--r--classes/Foreign_link.php16
1 files changed, 15 insertions, 1 deletions
diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php
index 4fcad4b17..f4f8abfc4 100644
--- a/classes/Foreign_link.php
+++ b/classes/Foreign_link.php
@@ -29,7 +29,6 @@ class Foreign_link extends DB_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) {
-
$flink = new Foreign_link();
$flink->whereAdd("service = $service");
$flink->whereAdd("user_id = $user_id");
@@ -43,4 +42,19 @@ class Foreign_link extends DB_DataObject
return NULL;
}
+ // Convenience method
+ function getForeignUser() {
+ $fuser = new Foreign_user();
+ $fuser->whereAdd('service = ' . $this->service);
+ $fuser->whereAdd('id = ' . $this->foreign_id);
+ $fuser->limit(1);
+
+ if ($fuser->find()) {
+ $fuser->fetch();
+ return $fuser;
+ }
+
+ return NULL;
+ }
+
}