summaryrefslogtreecommitdiff
path: root/app/Subscriber/ProjectDailySummarySubscriber.php
blob: eaa9d4687ea02a3174393c7e8a54631edfb3a0d1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

namespace Kanboard\Subscriber;

use Kanboard\Event\TaskEvent;
use Kanboard\Model\TaskModel;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;

class ProjectDailySummarySubscriber extends BaseSubscriber implements EventSubscriberInterface
{
    public static function getSubscribedEvents()
    {
        return array(
            TaskModel::EVENT_CREATE_UPDATE => 'execute',
            TaskModel::EVENT_CLOSE         => 'execute',
            TaskModel::EVENT_OPEN          => 'execute',
            TaskModel::EVENT_MOVE_COLUMN   => 'execute',
            TaskModel::EVENT_MOVE_SWIMLANE => 'execute',
        );
    }

    public function execute(TaskEvent $event)
    {
        $this->logger->debug('Subscriber executed: '.__METHOD__);
        $this->queueManager->push($this->projectMetricJob->withParams($event['task']['project_id']));
    }
}