<?php
/**
* @author Thomas HERISSON (contact@scaledev.fr)
* @copyright 2021 - ScaleDEV SAS, 12 RUE CHARLES MORET, 10120 ST ANDRE LES VERGERS
* @license commercial
*/
declare(strict_types=1);
namespace Bluue\CrmBundle\EventSubscriber;
use App\Event\DashboardWidgetsEvent;
use Bluue\CustomersBundle\Event\CustomerDashboardWidgetsEvent;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class DashboardSubscriber implements EventSubscriberInterface
{
/**
* @return string[]
*/
public static function getSubscribedEvents(): array
{
return [
DashboardWidgetsEvent::NAME => 'onLoad',
CustomerDashboardWidgetsEvent::NAME => 'customerDashboard'
];
}
/**
* @param DashboardWidgetsEvent $event
* @return void
*/
public function onLoad(DashboardWidgetsEvent $event): void
{
$event->addWidget('crm_bundle__dashboard_opportunities');
}
/**
* @param CustomerDashboardWidgetsEvent $event
* @return void
*/
public function customerDashboard(CustomerDashboardWidgetsEvent $event): void
{
$event->addWidget('crm_bundle__dashboard_opportunities');
}
}