<?php
/*
*
* This file is part of the PEC Platform NotificationBundle.
*
* (c) PEC project engineers & consultants
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Pec\Bundle\NotificationBundle;
use Pec\Bundle\NotificationBundle\Service\Channel\ChannelInterface;
use Pec\Bundle\NotificationBundle\Service\Channels\ChannelCompiler;
use Pec\Bundle\NotificationBundle\Service\Generator\GeneratorCompiler;
use Pec\Bundle\NotificationBundle\Service\Group\GroupInterface;
use Pec\Bundle\PlatformBundle\PecPlatformBundle;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
/**
* The Notification Bundle allows to notify users about actions being performed on objects via different channels.
*/
class PecNotificationBundle extends Bundle {
/**
*
* {@inheritDoc}
*
* @see \Symfony\Component\HttpKernel\Bundle\Bundle::build()
*/
public function build(ContainerBuilder $container): void {
$container->addCompilerPass(new ChannelCompiler());
$container->addCompilerPass(new GeneratorCompiler());
$container->registerForAutoconfiguration(GroupInterface::class)->addTag(GroupInterface::SERVICE_TAG);
$container->registerForAutoconfiguration(ChannelInterface::class)->addTag(ChannelInterface::SERVICE_TAG);
}
public static function getRequiredBundles(string $env, array &$requiredBundles = []): array {
if (isset($requiredBundles['PecNotificationBundle'])) {
return $requiredBundles;
}
$requiredBundles['PecNotificationBundle'] = '\Pec\Bundle\NotificationBundle\PecNotificationBundle';
PecPlatformBundle::getRequiredBundles($env, $requiredBundles);
return $requiredBundles;
}
}