<?php
namespace Claromentis\Projects\Subscribers;

$GLOBALS["__65da1b1ec2d6" . "653e8a0ab7848e" . "536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e5362" . "15"] ?: array()) + array("_f308b5365a6" . "b4fb74945c0a" . "8684ec06f" => base64_decode("RGVsZXRlVGFza" . "0NvbW1lbnRz"), "_3b81f81" . "17b73992" . "4b3158d3" . "721a0059" . "d" => base64_decode("RGVsZXRlUHJvamVjdENvbW1lb" . "nRz"));
use Claromentis\Comments\CommentsRepository;
use Claromentis\Core\Event\EventSubscriberInterface;
use Claromentis\Projects\Comments\CommentableProject;
use Claromentis\Projects\Comments\CommentableTask;
use Claromentis\Projects\Event\ProjectEvent;
use Claromentis\Projects\Event\ProjectPreDeleteEvent;
use Claromentis\Projects\Event\TaskEvent;
use Claromentis\Projects\Repository\TopicRepository;
class CommentableSubscriber implements EventSubscriberInterface
{
    
    
    
    
    protected $topic_repository;
    
    
    
    
    private $comments_repo;
    public function __construct(CommentsRepository $_5a395f9603adaec532fb07e67fb1a4de, TopicRepository $_018eed6448abbc8c4aae90cde2897af1)
    {
        $this->comments_repo = $_5a395f9603adaec532fb07e67fb1a4de;
        $this->topic_repository = $_018eed6448abbc8c4aae90cde2897af1;
    }
    
    
    
    
    public static function getSubscribedEvents()
    {
        return [
            
            
            
            
            ProjectPreDeleteEvent::NAME => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_3b81f8117b739924b3158d3721a0" . "059d"],
            
            
            
            
            TaskEvent::PRE_DELETE_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_f308b5365a6b4" . "fb74945c0a8684" . "ec06f"],
        ];
    }
    
    
    
    
    
    
    public function DeleteProjectComments(ProjectEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec) : void
    {
        $_5e1e8bdeb7dc6725dab2802927e4f193 = new CommentableProject();
        $_5e1e8bdeb7dc6725dab2802927e4f193->Load((int) $_e62ca7bbb93b52cafc82da1c2aefe9ec->GetProject()->GetId());
        $this->comments_repo->DeleteAllForObject($_5e1e8bdeb7dc6725dab2802927e4f193);
    }
    
    
    
    
    
    
    public function DeleteTaskComments(TaskEvent $_e62ca7bbb93b52cafc82da1c2aefe9ec) : void
    {
        $_5e1e8bdeb7dc6725dab2802927e4f193 = new CommentableTask();
        $_5e1e8bdeb7dc6725dab2802927e4f193->Load((int) $_e62ca7bbb93b52cafc82da1c2aefe9ec->GetTask()->GetId());
        $this->comments_repo->DeleteAllForObject($_5e1e8bdeb7dc6725dab2802927e4f193);
    }
}