original_string: public function afterAddingComment( $comment, $notification )
      {
          $contentID = $comment->attribute( 'contentobject_id' );
          $languageID = $comment->attribute( 'language_id' );
          $subscriptionType = 'ezcomcomment';
          //add subscription
  
          $subscription = ezcomSubscriptionManager::instance();
          $user = eZUser::instance();
          if ( $notification === true )
          {
              $subscription->addSubscription( $comment->attribute('email'),
                                              $user,
                                              $contentID,
                                              $languageID,
                                              $subscriptionType,
                                              $comment->attribute( 'created' ) );
          }
  
          // insert data into notification queue
          // if there is no subscription,not adding to notification queue
          if ( ezcomSubscription::exists( $contentID, $languageID, $subscriptionType, null, 1 ) )
          {
              $notification = ezcomNotification::create();
              $notification->setAttribute( 'contentobject_id', $comment->attribute('contentobject_id') );
              $notification->setAttribute( 'language_id', $comment->attribute( 'language_id' ) );
              $notification->setAttribute( 'comment_id', $comment->attribute( 'id' ) );
              $notification->store();
              eZDebugSetting::writeNotice( 'extension-ezcomments', 'Notification added to queue', __METHOD__ );
          }
      }
code: public function afterAddingComment( $comment, $notification )
      {
          $contentID = $comment->attribute( 'contentobject_id' );
          $languageID = $comment->attribute( 'language_id' );
          $subscriptionType = 'ezcomcomment';
          //add subscription
  
          $subscription = ezcomSubscriptionManager::instance();
          $user = eZUser::instance();
          if ( $notification === true )
          {
              $subscription->addSubscription( $comment->attribute('email'),
                                              $user,
                                              $contentID,
                                              $languageID,
                                              $subscriptionType,
                                              $comment->attribute( 'created' ) );
          }
  
          // insert data into notification queue
          // if there is no subscription,not adding to notification queue
          if ( ezcomSubscription::exists( $contentID, $languageID, $subscriptionType, null, 1 ) )
          {
              $notification = ezcomNotification::create();
              $notification->setAttribute( 'contentobject_id', $comment->attribute('contentobject_id') );
              $notification->setAttribute( 'language_id', $comment->attribute( 'language_id' ) );
              $notification->setAttribute( 'comment_id', $comment->attribute( 'id' ) );
              $notification->store();
              eZDebugSetting::writeNotice( 'extension-ezcomments', 'Notification added to queue', __METHOD__ );
          }
      }
code_tokens: public function afterAddingComment ( $ comment , $ notification ) { $ contentID = $ comment -> attribute ( 'contentobject_id' ) ; $ languageID = $ comment -> attribute ( 'language_id' ) ; $ subscriptionType = 'ezcomcomment' ; //add subscription $ subscription = ezcomSubscriptionManager :: instance ( ) ; $ user = eZUser :: instance ( ) ; if ( $ notification === true ) { $ subscription -> addSubscription ( $ comment -> attribute ( 'email' ) , $ user , $ contentID , $ languageID , $ subscriptionType , $ comment -> attribute ( 'created' ) ) ; } // insert data into notification queue // if there is no subscription,not adding to notification queue if ( ezcomSubscription :: exists ( $ contentID , $ languageID , $ subscriptionType , null , 1 ) ) { $ notification = ezcomNotification :: create ( ) ; $ notification -> setAttribute ( 'contentobject_id' , $ comment -> attribute ( 'contentobject_id' ) ) ; $ notification -> setAttribute ( 'language_id' , $ comment -> attribute ( 'language_id' ) ) ; $ notification -> setAttribute ( 'comment_id' , $ comment -> attribute ( 'id' ) ) ; $ notification -> store ( ) ; eZDebugSetting :: writeNotice ( 'extension-ezcomments' , 'Notification added to queue' , __METHOD__ ) ; } }
docstring: add subscription after adding comment
  1) If 'notification' is true
  add the user as a subscriber if subscriber with same email doesn't exist
  otherwise get the subscriber
  2) If 'notification' is true
  if the subscription with user's email and contentid doesn't exist, add a new subscription,
  3) If there is subscription, add the comment into notifiction queue
  
  @see extension/ezcomments/classes/ezcomCommentManager#afterAddingComment($comment)
docstring_tokens: add subscription after adding comment 1 ) If notification is true add the user as a subscriber if subscriber with same email doesn t exist otherwise get the subscriber 2 ) If notification is true if the subscription with user s email and contentid doesn t exist add a new subscription 3 ) If there is subscription add the comment into notifiction queue