<?php
namespace Claromentis\Projects\Subscribers;

$GLOBALS["__65da1b1ec2d6653e8a0ab" . "7848e536215"] = (@$GLOBALS["__65da1b1ec2d6653e8" . "a0ab7848e536215"] ?: array()) + array("_3b81f8117b739" . "924b3158d3721a" . "0059d" => base64_decode("RGVsZXRlU" . "HJvamVjdE" . "NvbW1lbnR" . "z"), "_f308b536" . "5a6b4fb74" . "945c0a868" . "4ec06f" => base64_decode("RGVsZXRlVGFza0NvbW1l" . "bnRz"));
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["__65da1b1ec2d6653e8a" . "0ab7848e536215"]["_3b81f8117b739924b3158d" . "3721a0059d"],
            
            
            
            
            TaskEvent::PRE_DELETE_EVENT => $GLOBALS["__65da1b1ec2d6653" . "e8a0ab7848e536215"]["_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);
    }
}