forked from EC-CUBE/related-product-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEvent.php
110 lines (100 loc) · 2.74 KB
/
Event.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<?php
/*
* This file is part of the Related Product plugin
*
* Copyright (C) 2016 LOCKON CO.,LTD. All Rights Reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Plugin\RelatedProduct;
use Eccube\Application;
use Plugin\RelatedProduct\Utils\Version;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Eccube\Event\TemplateEvent;
use Eccube\Event\EventArgs;
/**
* Class Event for new hook point on version >= 3.0.9.
*/
class Event
{
/**
* @var Application
*/
private $app;
/**
* Event constructor.
*
* @param Application $app
*/
public function __construct($app)
{
$this->app = $app;
}
/**
* フロント:商品詳細画面に関連商品を表示.
*
* @param TemplateEvent $event
*/
public function onRenderProductDetail(TemplateEvent $event)
{
$this->app['eccube.plugin.relatedproduct.event']->onRenderProductDetail($event);
}
/**
* new hookpoint for init product edit.
*
* @param EventArgs $event
*/
public function onRenderAdminProductInit(EventArgs $event)
{
$this->app['eccube.plugin.relatedproduct.event']->onRenderAdminProductInit($event);
}
/**
* new hookpoint for render RelatedProduct form.
*
* @param TemplateEvent $event
*/
public function onRenderAdminProduct(TemplateEvent $event)
{
$this->app['eccube.plugin.relatedproduct.event']->onRenderAdminProduct($event);
}
/**
* new hookpoint for save RelatedProduct.
*
* @param EventArgs $event
*/
public function onRenderAdminProductComplete(EventArgs $event)
{
$this->app['eccube.plugin.relatedproduct.event']->onRenderAdminProductComplete($event);
}
/**
* for v3.0.0 - 3.0.8.
*
* @deprecated for since v3.0.0, to be removed in 3.1
*
* @param FilterResponseEvent $event
*/
public function onRenderProductDetailBefore(FilterResponseEvent $event)
{
//current version >= 3.0.9
if (Version::isSupportNewHookpoint()) {
return;
}
$this->app['eccube.plugin.relatedproduct.event.legacy']->onRenderProductDetailBefore($event);
}
/**
* for v3.0.0 - 3.0.8.
*
* @deprecated for since v3.0.0, to be removed in 3.1
*
* @param FilterResponseEvent $event
*/
public function onRenderAdminProductEditBefore(FilterResponseEvent $event)
{
//current version >= 3.0.9
if (Version::isSupportNewHookpoint()) {
return;
}
$this->app['eccube.plugin.relatedproduct.event.legacy']->onRenderAdminProductEditBefore($event);
}
}