summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-09-23 01:44:13 -0400
committerEvan Prodromou <evan@controlyourself.ca>2008-09-23 01:44:13 -0400
commit858e55f5b41011bdba78d52fd6bd48bd655f2656 (patch)
tree5bfab5f1535e734f91643f0db87ee18307b88574 /classes
parent44f7dc2a76fcc06afdeee8fbb243227ab8f51d90 (diff)
change how Foreign_link fetches, and fix mixup between user-ids and foreign-ids in twittersettings
darcs-hash:20080923054413-5ed1f-a317e07925101215e87d2db0c574d20c1cfac665.gz
Diffstat (limited to 'classes')
-rw-r--r--classes/Foreign_link.php19
1 files changed, 10 insertions, 9 deletions
diff --git a/classes/Foreign_link.php b/classes/Foreign_link.php
index f4f8abfc4..0c6df8ffc 100644
--- a/classes/Foreign_link.php
+++ b/classes/Foreign_link.php
@@ -30,12 +30,11 @@ class Foreign_link extends DB_DataObject
// 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->service = $service;
+ $flink->user_id = $user_id;
$flink->limit(1);
- if ($flink->find()) {
- $flink->fetch();
+ if ($flink->find(TRUE)) {
return $flink;
}
@@ -43,14 +42,16 @@ class Foreign_link extends DB_DataObject
}
// Convenience method
- function getForeignUser() {
+ function getForeignUser() {
+
$fuser = new Foreign_user();
- $fuser->whereAdd('service = ' . $this->service);
- $fuser->whereAdd('id = ' . $this->foreign_id);
+
+ $fuser->service = $this->service;
+ $fuser->id = $this->foreign_id;
+
$fuser->limit(1);
- if ($fuser->find()) {
- $fuser->fetch();
+ if ($fuser->find(TRUE)) {
return $fuser;
}