-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathJodaYellowBox.php
49 lines (40 loc) · 1.3 KB
/
JodaYellowBox.php
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
declare(strict_types=1);
namespace JodaYellowBox;
use JodaYellowBox\Components\NotificationCenter\NotificationCenterCompilerPass;
use JodaYellowBox\Setup\Installer;
use Shopware\Components\Plugin;
use Shopware\Components\Plugin\Context\UninstallContext;
use Symfony\Component\DependencyInjection\ContainerBuilder;
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
require_once __DIR__ . '/vendor/autoload.php';
}
class JodaYellowBox extends Plugin
{
/**
* @param ContainerBuilder $container
*/
public function build(ContainerBuilder $container)
{
$config = include $this->getPath() . '/Resources/StateMachine/config.php';
$container->setParameter('joda_yellow_box.sm.configs', [$config]);
$container->addCompilerPass(new NotificationCenterCompilerPass());
parent::build($container);
}
/**
* @param Plugin\Context\InstallContext $context
*/
public function install(Plugin\Context\InstallContext $context)
{
$installer = new Installer($this->container);
$installer->install($context);
}
/**
* @param UninstallContext $context
*/
public function uninstall(UninstallContext $context)
{
$installer = new Installer($this->container);
$installer->uninstall($context);
}
}