Newscoop\ArticlesBundle\Services\EditorialCommentsService::remove PHP Метод

remove() публичный Метод

Remove (soft) existing editorial comment
public remove ( EditorialComment $comment, User $user )
$comment Newscoop\ArticlesBundle\Entity\EditorialComment
$user Newscoop\Entity\User
    public function remove(EditorialComment $comment, User $user)
    {
        if ($comment->getUser()->getId() == $user->getId() || $user->isAdmin()) {
            $comment->setIsActive(false);
        } else {
            throw new AccessDeniedHttpException("User is not allowed to remove comment");
        }
        $this->em->flush();
        return true;
    }