summaryrefslogtreecommitdiff
path: root/classes/Foreign_user.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Foreign_user.php')
-rw-r--r--classes/Foreign_user.php25
1 files changed, 25 insertions, 0 deletions
diff --git a/classes/Foreign_user.php b/classes/Foreign_user.php
index d19370aa0..25a6ac979 100644
--- a/classes/Foreign_user.php
+++ b/classes/Foreign_user.php
@@ -22,4 +22,29 @@ class Foreign_user extends DB_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+
+ static function save($fields) {
+
+ extract($fields);
+
+ $fuser = new Foreign_user();
+
+ $fuser->id = $id;
+ $fuser->service = $service;
+ $fuser->uri = $uri;
+ $fuser->nickname = $nickname;
+ $fuser->user_id = $user_id;
+ $fuser->credentials = $credentials;
+ $fuser->created = common_sql_now();
+
+ $result = $fuser->insert();
+
+ if (!$result) {
+ common_log_db_error($fuser, 'INSERT', __FILE__);
+ return FALSE;
+ }
+
+ return $fuser;
+ }
+
}