2014-05-03 19:50:35 +02:00
|
|
|
<?php
|
2014-05-03 22:18:41 +02:00
|
|
|
class ScorePostJob extends AbstractPostJob
|
2014-05-03 19:50:35 +02:00
|
|
|
{
|
|
|
|
const SCORE = 'score';
|
|
|
|
|
|
|
|
public function execute()
|
|
|
|
{
|
|
|
|
$post = $this->post;
|
|
|
|
$score = intval($this->getArgument(self::SCORE));
|
|
|
|
|
|
|
|
UserModel::updateUserScore(Auth::getCurrentUser(), $post, $score);
|
|
|
|
}
|
|
|
|
|
|
|
|
public function requiresPrivilege()
|
|
|
|
{
|
|
|
|
return
|
|
|
|
[
|
|
|
|
Privilege::ScorePost,
|
|
|
|
Access::getIdentity($this->post->getUploader())
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|