/**
  * Action called for unsubscription to press reviews
  */
 public function unsubscribeAction()
 {
     try {
         $email = $this->getParam("email", null);
         if (!$email) {
             Flash::addItem(__("Requête invalide", "s1b"));
         } else {
             $email = trim($email);
             /* @var $pressReviewsSubscriber PressReviewsSubscriber */
             $pressReviewsSubscriber = PressReviewsSubscriberDao::getInstance()->getByEmail($email);
             if ($pressReviewsSubscriber) {
                 // Mark the press review subscriber as deleted
                 $pressReviewsSubscriber->setIs_deleted(true);
                 PressReviewsSubscriberDao::getInstance()->update($pressReviewsSubscriber);
                 Flash::addItem(__("Votre désinscription a bien été pris en compte.", "s1b"));
             } else {
                 Flash::addItem(__("Il n'y a pas d'abonné correspondant à l'email fourni.", "s1b"));
             }
         }
         HTTPHelper::redirectToHome();
     } catch (\Exception $e) {
         Trace::addItem(sprintf("Une erreur s'est produite dans \"%s->%s\", TRACE : %s\"", get_class(), __FUNCTION__, $e->getTraceAsString()));
         $this->forward("error", "error", "default");
     }
 }
 public function isValid($value)
 {
     $valid = true;
     $this->_setValue($value);
     $result = PressReviewsSubscriberDao::getInstance()->getNonDeletedPressReviewsSubscriberByEmail($value);
     if ($result) {
         $valid = false;
         $this->_error(self::PRESS_REVIEW_SUBSCRIBER_EXISTS);
     }
     return $valid;
 }