summaryrefslogtreecommitdiff
path: root/plugins/UserFlag/flagprofile.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-12-28 10:58:49 -0800
committerEvan Prodromou <evan@status.net>2009-12-28 10:58:49 -0800
commit6d3e6b42849ad14b15cb4c41c4f8baac45e58df0 (patch)
tree77eb93add9e83fd85493fee896944cd0d4946ac4 /plugins/UserFlag/flagprofile.php
parent2ae04bb6d598c74763aca79ab52172934158be46 (diff)
move flag creation to a method of data object
Diffstat (limited to 'plugins/UserFlag/flagprofile.php')
-rw-r--r--plugins/UserFlag/flagprofile.php14
1 files changed, 2 insertions, 12 deletions
diff --git a/plugins/UserFlag/flagprofile.php b/plugins/UserFlag/flagprofile.php
index 55753f4e8..2d0f0abb9 100644
--- a/plugins/UserFlag/flagprofile.php
+++ b/plugins/UserFlag/flagprofile.php
@@ -105,19 +105,9 @@ class FlagprofileAction extends ProfileFormAction
assert(!empty($user));
assert(!empty($this->profile));
- $ufp = new User_flag_profile();
+ // throws an exception on error
- $ufp->profile_id = $this->profile->id;
- $ufp->user_id = $user->id;
- $ufp->created = common_sql_now();
-
- if (!$ufp->insert()) {
- $msg = sprintf(_("Couldn't flag profile '%s' for review."),
- $this->profile->nickname);
- throw new ServerException($msg);
- }
-
- $ufp->free();
+ User_flag_profile::create($user->id, $this->profile->id);
if ($this->boolean('ajax')) {
$this->ajaxResults();