<?php
namespace Claromentis\Projects\Subscribers;

$GLOBALS["__65da1b1e" . "c2d6653e8a" . "0ab7848e53" . "6215"] = (@$GLOBALS["__65da1b1ec2" . "d6653e8a0ab7" . "848e536215"] ?: array()) + array("_f308b5365" . "a6b4fb7494" . "5c0a8684ec" . "06f" => base64_decode("RGVsZXRlVGFza0NvbW1lbnR" . "z"), "_3b81f8117b739924b3158d3721a0" . "059d" => base64_decode("RGVsZXRlUHJvamVjdENv" . "bW1lbnRz"));
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["__65da1b1ec2d665" . "3e8a0ab7848e5362" . "15"]["_3b81f81" . "17b73992" . "4b3158d3" . "721a0059" . "d"],
            
            
            
            
            TaskEvent::PRE_DELETE_EVENT => $GLOBALS["__65da1b1ec2d6653e8a0ab7" . "848e536215"]["_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);
    }
}