Esempio n. 1
0
 /**
  * Checks if a new subscription should be added
  *
  * @param Comment $comment
  *
  * @return boolean
  */
 protected function isNewSubscriptionValid(Comment $comment)
 {
     if (!$this->settings['blogsystem']['comments']['subscribeForComments'] || !$comment->getSubscribe()) {
         return FALSE;
     }
     // check if user already registered
     $subscribers = $this->subscriberRepository->findExistingSubscriptions($comment->getPostId(), $comment->getEmail());
     if (count($subscribers) > 0) {
         $this->log->notice('Subscriber [' . $comment->getEmail() . '] already registered.');
         return FALSE;
     }
     return TRUE;
 }