<?php
namespace Claromentis\Blog\Comments;

$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec" . "2d6653e8a0a" . "b7848e53621" . "5"] ?: array()) + array("_191a9c694701b5e98f9b02b" . "73105f5cf" => base64_decode("Q29tbWVudERlbGV0ZWR" . "FdmVudFJlY2VpdmVy"), "_d0f341c8111d" . "6625af309dc9b" . "3634587" => base64_decode("Ymx" . "vZw" . "=="), "_e8d840684607f6c" . "2bbef52309064216" . "8" => base64_decode("Y29tbWVudA=" . "="), "_e8d7d527b284cadd317dfbdb10b34e" . "4e" => base64_decode("Q29tbWVudFVwZGF0" . "ZWRFdmVudFJlY2Vp" . "dmVy"), "_58dea8ade79001687dfa378c6ac73f" . "21" => base64_decode("QmxvZyBjb21tZW50I" . "CM="), "_2e799a34cc60c12ca" . "876d27b573a11eb" => base64_decode("IGFk" . "ZGVk"), "_d50d529d5739d10" . "3bc48e65a4b513fe" . "3" => base64_decode("Q29tbWVudEFkZGVkRXZlbnRSZWNla" . "XZlcg=="));
use ClaAudit;
use Claromentis\Comments\Events\CommentAddedEvent;
use Claromentis\Comments\Events\CommentDeletedEvent;
use Claromentis\Comments\Events\CommentUpdatedEvent;
use Claromentis\Comments\Model\Comment;
use Claromentis\Search\Indexing\IndexingQueue;
use Claromentis\Search\ItemType\Indexing\BlogPost;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;





class CommentsSubscriber implements EventSubscriberInterface
{
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    public static function getSubscribedEvents()
    {
        return [CommentAddedEvent::EVENT_NAME => $GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"]["_d50d529d5" . "739d103bc4" . "8e65a4b513" . "fe3"], CommentDeletedEvent::EVENT_NAME => $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_191a9c6947" . "01b5e98f9b0" . "2b73105f5cf"], CommentUpdatedEvent::EVENT_NAME => $GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"]["_e8d7d527b284cadd317dfbd" . "b10b34e4e"]];
    }
    public function CommentAddedEventReceiver(CommentAddedEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec, $_5693d84b45564f912e36404cbe8957e8, EventDispatcherInterface $_b497ce6f2af10f67516aed0ecf34d8cf)
    {
        
        
        $_e8d840684607f6c2bbef523090642168 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->GetComment();
        if ((int) $_e8d840684607f6c2bbef523090642168->aggregation === AGGREGATION_BLOG) {
            IndexingQueue::Reindex(BlogPost::TYPE_NAME, $_e8d840684607f6c2bbef523090642168->object_id);
            ClaAudit::Store(AUDIT_SUCCESS, $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_d0f341c" . "8111d662" . "5af309dc" . "9b363458" . "7"], $GLOBALS["__65da1b1ec2d6653e8a0a" . "b7848e536215"]["_e8d840684607" . "f6c2bbef52309" . "0642168"], $_e8d840684607f6c2bbef523090642168->object_id, $GLOBALS["__65da1b1ec2d66" . "53e8a0ab7848e53" . "6215"]["_58dea8ade79001687dfa378c6a" . "c73f21"] . $_e8d840684607f6c2bbef523090642168->id . $GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"]["_2e799a34cc" . "60c12ca876d" . "27b573a11eb"]);
            $_e62ca7bbb93b52cafc82da1c2aefe9ec->stopPropagation();
        }
    }
    public function CommentDeletedEventReceiver(CommentDeletedEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        
        
        $_e8d840684607f6c2bbef523090642168 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->GetComment();
        if ((int) $_e8d840684607f6c2bbef523090642168->aggregation === AGGREGATION_BLOG) {
            IndexingQueue::Reindex(BlogPost::TYPE_NAME, $_e8d840684607f6c2bbef523090642168->object_id);
            $_e62ca7bbb93b52cafc82da1c2aefe9ec->stopPropagation();
        }
    }
    public function CommentUpdatedEventReceiver(CommentUpdatedEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec)
    {
        
        
        $_e8d840684607f6c2bbef523090642168 = $_e62ca7bbb93b52cafc82da1c2aefe9ec->GetComment();
        if ((int) $_e8d840684607f6c2bbef523090642168->aggregation === AGGREGATION_BLOG) {
            IndexingQueue::Reindex(BlogPost::TYPE_NAME, $_e8d840684607f6c2bbef523090642168->object_id);
            $_e62ca7bbb93b52cafc82da1c2aefe9ec->stopPropagation();
        }
    }
}