-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathOrderPdfEvent.php
79 lines (71 loc) · 1.83 KB
/
OrderPdfEvent.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
<?php
/*
* This file is part of the Order Pdf plugin
*
* Copyright (C) EC-CUBE 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\OrderPdf;
use Eccube\Application;
use Eccube\Event\TemplateEvent;
use Plugin\OrderPdf\Event\OrderPdf;
use Plugin\OrderPdf\Event\OrderPdfLegacy;
use Plugin\OrderPdf\Util\Version;
use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
/**
* Class OrderPdf Event.
*/
class OrderPdfEvent
{
/**
* @var Application
*/
private $app;
/**
* OrderPdfEvent constructor.
*
* @param \Silex\Application $app
*/
public function __construct($app)
{
$this->app = $app;
}
/**
* Event for new hook point.
*
* @param TemplateEvent $event
*/
public function onAdminOrderIndexRender(TemplateEvent $event)
{
/* @var OrderPdf $orderPdfEvent */
$orderPdfEvent = $this->app['orderpdf.event.order_pdf'];
$orderPdfEvent->onAdminOrderIndexRender($event);
}
/**
* Event for v3.0.0 - 3.0.8.
*
* @param FilterResponseEvent $event
*
* @deprecated for since v3.0.0, to be removed in 3.1
*/
public function onRenderAdminOrderPdfBefore(FilterResponseEvent $event)
{
if ($this->supportNewHookPoint()) {
return;
}
/* @var OrderPdfLegacy $eventLegacy */
$eventLegacy = $this->app['orderpdf.event.order_pdf_legacy'];
$eventLegacy->onRenderAdminOrderPdfBefore($event);
}
/**
* Check to support new hookpoint.
*
* @return bool v3.0.9以降のフックポイントに対応しているか?
*/
private function supportNewHookPoint()
{
return Version::isSupportVersion();
}
}