<?php
namespace Claromentis\Projects\Subscribers;

$GLOBALS["__65da1b1ec2d6653e8a0" . "ab7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8a0ab7848e" . "536215"] ?: array()) + array("_3b81f8117b739924b3158d3721a005" . "9d" => base64_decode("RGVsZXRlUHJvamVjdENvbW1" . "lbnRz"), "_f308b5365a6b4fb74945c0a8" . "684ec06f" => base64_decode("RGVsZXRlVGFza0NvbW1" . "lbnRz"));
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["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"]["_3b81f8117b739924b3158d37" . "21a0059d"],
            
            
            
            
            TaskEvent::PRE_DELETE_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0ab7848e536" . "215"]["_f308b5365a6b4fb74945c0a8684" . "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);
    }
}