public function updateUserPoints(GenericEvent $event)
{
$params = $event->getArguments();
$user = null;
$authorId = null;
if (array_key_exists('user', $params)) {
$user = $params['user'];
if (is_numeric($params['user'])) {
$user = $this->find($params['user']);
}
}
if (array_key_exists('authorId', $params)) {
$authorId = $params['authorId'];
}
if ($user || $authorId) {
$this->getRepository()->setUserPoints($user, $authorId);
}
}