|
1
|
|
|
<?php |
|
2
|
|
|
/* |
|
3
|
|
|
* This file is part of EC-CUBE |
|
4
|
|
|
* |
|
5
|
|
|
* Copyright(c) 2000-2015 LOCKON CO.,LTD. All Rights Reserved. |
|
6
|
|
|
* |
|
7
|
|
|
* http://www.lockon.co.jp/ |
|
8
|
|
|
* |
|
9
|
|
|
* This program is free software; you can redistribute it and/or |
|
10
|
|
|
* modify it under the terms of the GNU General Public License |
|
11
|
|
|
* as published by the Free Software Foundation; either version 2 |
|
12
|
|
|
* of the License, or (at your option) any later version. |
|
13
|
|
|
* |
|
14
|
|
|
* This program is distributed in the hope that it will be useful, |
|
15
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
16
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
17
|
|
|
* GNU General Public License for more details. |
|
18
|
|
|
* |
|
19
|
|
|
* You should have received a copy of the GNU General Public License |
|
20
|
|
|
* along with this program; if not, write to the Free Software |
|
21
|
|
|
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
|
22
|
|
|
*/ |
|
23
|
|
|
|
|
24
|
|
|
namespace Eccube\Service; |
|
25
|
|
|
|
|
26
|
|
|
use Eccube\Annotation\Inject; |
|
27
|
|
|
use Eccube\Annotation\Service; |
|
28
|
|
|
use Eccube\Entity\Cart; |
|
29
|
|
|
use Eccube\Entity\Customer; |
|
30
|
|
|
use Eccube\Entity\Order; |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
34
|
|
|
* @Service |
|
35
|
|
|
*/ |
|
36
|
|
|
class OrderService |
|
37
|
|
|
{ |
|
38
|
|
|
/** |
|
39
|
|
|
* @Inject(ShoppingService::class) |
|
40
|
|
|
* @var ShoppingService |
|
41
|
|
|
*/ |
|
42
|
|
|
protected $shoppingService; |
|
43
|
|
|
|
|
44
|
|
|
|
|
45
|
|
|
/** |
|
46
|
|
|
* 商品種別を取得 |
|
47
|
|
|
* |
|
48
|
|
|
* @param Order $Order |
|
49
|
|
|
* @return array |
|
50
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
51
|
|
|
*/ |
|
52
|
1 |
|
public function getProductTypes(Order $Order) |
|
53
|
|
|
{ |
|
54
|
1 |
|
return $Order->getProductTypes(); |
|
55
|
|
|
} |
|
56
|
|
|
|
|
57
|
|
|
/** |
|
58
|
|
|
* 下位互換用関数 |
|
59
|
|
|
* |
|
60
|
|
|
* @return Order |
|
61
|
|
|
* |
|
62
|
|
|
* @see ShoppingService::newOrder() |
|
63
|
|
|
* |
|
64
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
65
|
|
|
*/ |
|
66
|
|
|
public function newOrder() |
|
67
|
|
|
{ |
|
68
|
|
|
return $this->shoppingService->newOrder(); |
|
69
|
|
|
} |
|
70
|
|
|
|
|
71
|
|
|
/** |
|
|
|
|
|
|
72
|
|
|
* 下位互換用関数 |
|
73
|
|
|
* |
|
74
|
|
|
* @param $cartItems |
|
|
|
|
|
|
75
|
|
|
* @param Customer|null $Customer |
|
76
|
|
|
* @param $preOrderId |
|
|
|
|
|
|
77
|
|
|
* @return Order |
|
78
|
|
|
* |
|
79
|
|
|
* @see ShoppingService::createOrder() |
|
80
|
|
|
* |
|
81
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
82
|
|
|
*/ |
|
83
|
|
|
public function registerPreOrderFromCartItems($cartItems, Customer $Customer = null, $preOrderId) |
|
|
|
|
|
|
84
|
|
|
{ |
|
85
|
|
|
return $this->shoppingService->createOrder($Customer); |
|
86
|
|
|
} |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* 下位互換用関数 |
|
90
|
|
|
* |
|
91
|
|
|
* @param Order $Order |
|
92
|
|
|
* @param Cart $Cart |
|
|
|
|
|
|
93
|
|
|
* @return Order |
|
94
|
|
|
* |
|
95
|
|
|
* @see ShoppingService::getAmount() |
|
96
|
|
|
* |
|
97
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
98
|
|
|
*/ |
|
99
|
|
|
public function getAmount(Order $Order, Cart $Cart) |
|
|
|
|
|
|
100
|
|
|
{ |
|
101
|
|
|
return $this->shoppingService->getAmount($Order); |
|
|
|
|
|
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
|
|
|
|
|
105
|
|
|
* 下位互換用関数 |
|
106
|
|
|
* |
|
107
|
|
|
* @param $em トランザクション制御されているEntityManager |
|
|
|
|
|
|
108
|
|
|
* @param Order $Order 受注情報 |
|
|
|
|
|
|
109
|
|
|
* @param $formData フォームデータ |
|
|
|
|
|
|
110
|
|
|
* |
|
111
|
|
|
* @see ShoppingService::setOrderUpdate() |
|
112
|
|
|
* |
|
113
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
114
|
|
|
*/ |
|
115
|
|
|
public function setOrderUpdate($em, Order $Order, $formData) |
|
|
|
|
|
|
116
|
|
|
{ |
|
117
|
|
|
$this->shoppingService->setOrderUpdate($Order, $formData); |
|
|
|
|
|
|
118
|
|
|
} |
|
119
|
|
|
|
|
120
|
|
|
/** |
|
|
|
|
|
|
121
|
|
|
* 下位互換用関数 |
|
122
|
|
|
* |
|
123
|
|
|
* @param $em トランザクション制御されているEntityManager |
|
|
|
|
|
|
124
|
|
|
* @param Order $Order 受注情報 |
|
|
|
|
|
|
125
|
|
|
* @param Customer $user ログインユーザ |
|
|
|
|
|
|
126
|
|
|
* |
|
127
|
|
|
* @see ShoppingService::setCustomerUpdate() |
|
128
|
|
|
* |
|
129
|
|
|
* @deprecated since 3.0.0, to be removed in 3.1 |
|
130
|
|
|
*/ |
|
131
|
|
|
public function setCustomerUpdate($em, Order $Order, Customer $user) |
|
|
|
|
|
|
132
|
|
|
{ |
|
133
|
|
|
$this->shoppingService->setCustomerUpdate($Order, $user); |
|
134
|
|
|
} |
|
135
|
|
|
|
|
136
|
|
|
|
|
137
|
|
|
} |
|
138
|
|
|
|