-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPluginManager.php
38 lines (32 loc) · 1.26 KB
/
PluginManager.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
<?php
/**
* This file is part of CustomerGroupProduct
*
* Copyright(c) Akira Kurozumi <info@a-zumi.net>
*
* https://a-zumi.net
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\CustomerGroupProduct;
use Doctrine\ORM\EntityManagerInterface;
use Eccube\Entity\Plugin;
use Eccube\Plugin\AbstractPluginManager;
use Symfony\Component\DependencyInjection\ContainerInterface;
use Symfony\Component\HttpKernel\Exception\HttpException;
class PluginManager extends AbstractPluginManager
{
public function enable(array $meta, ContainerInterface $container)
{
/** @var EntityManagerInterface $entityManager */
$entityManager = $container->get('doctrine.orm.entity_manager');
$Plugin = $entityManager
->getRepository(Plugin::class)
->findOneBy(['code' => 'CustomerGroup', 'enabled' => true]);
if (is_null($Plugin)) {
log_error('会員グループ管理プラグイン for EC-CUBE4が有効化されていないので有効化できません');
throw new HttpException(400, '会員グループ管理プラグイン for EC-CUBE4が有効化されていないので有効化できません');
}
}
}