summaryrefslogtreecommitdiff
path: root/classes/Fave.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@prodromou.name>2008-09-08 14:16:24 -0400
committerEvan Prodromou <evan@prodromou.name>2008-09-08 14:16:24 -0400
commita8a36677748b304faf20742598b90f3d9634f393 (patch)
tree1696b4c28db055544910f7f06786cfe97f4338b9 /classes/Fave.php
parent75f285ddf6decb4f8c3b1b87d29d9b12f833e9fc (diff)
initial non-Ajax version of favorites
darcs-hash:20080908181624-84dde-8200e1d91eb5f560ef0f296c9e1c56f93ef1b0c5.gz
Diffstat (limited to 'classes/Fave.php')
-rw-r--r--classes/Fave.php11
1 files changed, 11 insertions, 0 deletions
diff --git a/classes/Fave.php b/classes/Fave.php
index bbd72ca0b..572dc232e 100644
--- a/classes/Fave.php
+++ b/classes/Fave.php
@@ -19,4 +19,15 @@ class Fave extends DB_DataObject
/* the code above is auto generated do not remove the tag below */
###END_AUTOCODE
+
+ static function addNew($user, $notice) {
+ $fave = new Fave();
+ $fave->user_id = $user->id;
+ $fave->notice_id = $notice->id;
+ if (!$fave->insert()) {
+ common_log_db_error($fave, 'INSERT', __FILE__);
+ return false;
+ }
+ return $fave;
+ }
}