@@ -75,13 +75,22 @@ public function __construct(
75
75
* @param Customer|null $customer
76
76
* @param Website|null $website
77
77
* @return CombinedPriceList|null
78
+ *
79
+ * @throws \LogicException
78
80
*/
79
81
public function getPriceList (Customer $ customer = null , Website $ website = null )
80
82
{
81
83
if (!$ website ) {
82
84
$ website = $ this ->websiteManager ->getCurrentWebsite ();
83
85
}
84
86
87
+ if (null === $ website ) {
88
+ throw new \LogicException (\sprintf (
89
+ 'When "%s" is called not in a storefront context, a website must be passed as a parameter ' ,
90
+ __METHOD__
91
+ ));
92
+ }
93
+
85
94
$ key = $ this ->getUniqueKey ($ customer , $ website );
86
95
if (array_key_exists ($ key , $ this ->priceLists )) {
87
96
return $ this ->priceLists [$ key ];
@@ -123,8 +132,8 @@ protected function getPriceListByCustomer(Customer $customer, Website $website)
123
132
}
124
133
125
134
/**
126
- * @param Customer|null $customer
127
- * @param Website|null $website
135
+ * @param Customer $customer
136
+ * @param Website $website
128
137
* @return null|CombinedPriceList
129
138
*/
130
139
protected function getPriceListByCustomerGroup (Customer $ customer , Website $ website )
@@ -139,7 +148,7 @@ protected function getPriceListByCustomerGroup(Customer $customer, Website $webs
139
148
}
140
149
141
150
/**
142
- * @param Website|null $website
151
+ * @param Website $website
143
152
* @return null|CombinedPriceList
144
153
*/
145
154
protected function getPriceListByAnonymousCustomerGroup (Website $ website )
0 commit comments