Newscoop\ArticlesBundle\Entity\EditorialComment::setIsActive PHP Method

setIsActive() public method

Sets the value of is_active.
public setIsActive ( boolean $is_active ) : self
$is_active boolean the is active
return self
    public function setIsActive($is_active)
    {
        $this->is_active = $is_active;
        return $this;
    }

Usage Example

 /**
  * Remove (soft) existing editorial comment
  * @param EditorialComment $comment
  * @param User             $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;
 }
All Usage Examples Of Newscoop\ArticlesBundle\Entity\EditorialComment::setIsActive