diff options
author | Zach Copley <zach@controlyourself.ca> | 2008-08-28 15:25:09 -0400 |
---|---|---|
committer | Zach Copley <zach@controlyourself.ca> | 2008-08-28 15:25:09 -0400 |
commit | 412eae10fe81c6493f3ca5e05d7365839045f54e (patch) | |
tree | 74dabbb164a1ed6fe0fb33c5c154a7c2895765a0 /classes | |
parent | bf14709fe2ed18f5a2641f841cb000a4856290fd (diff) |
Twitter integration - Notices now broadcast (directly) to Twitter from linked accts.
darcs-hash:20080828192509-7b5ce-8387c67500c082eb5a0107c0f78d4cf5620825af.gz
Diffstat (limited to 'classes')
-rw-r--r-- | classes/Foreign_link.php | 16 |
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; + } + } |