3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+ declare (strict_types=1 );
6
7
7
8
namespace Magento \Weee \Model \Attribute \Backend \Weee ;
8
9
10
+ use Magento \Catalog \Model \ResourceModel \Eav \Attribute ;
9
11
use Magento \Framework \Exception \LocalizedException ;
10
12
use Magento \Catalog \Model \Attribute \ScopeOverriddenValue ;
11
13
14
+ /**
15
+ * Class with fixed product taxes.
16
+ */
12
17
class Tax extends \Magento \Catalog \Model \Product \Attribute \Backend \Price
13
18
{
14
19
/**
@@ -62,6 +67,8 @@ public function __construct(
62
67
}
63
68
64
69
/**
70
+ * Get backend model name.
71
+ *
65
72
* @return string
66
73
*/
67
74
public static function getBackendModelName ()
@@ -91,8 +98,10 @@ public function validate($object)
91
98
$ key1 = implode ('- ' , [$ tax ['website_id ' ], $ tax ['country ' ], $ state ]);
92
99
if (!empty ($ dup [$ key1 ])) {
93
100
throw new LocalizedException (
94
- __ ('Set unique country-state combinations within the same fixed product tax. '
95
- . 'Verify the combinations and try again. ' )
101
+ __ (
102
+ 'Set unique country-state combinations within the same fixed product tax. '
103
+ . 'Verify the combinations and try again. '
104
+ )
96
105
);
97
106
}
98
107
$ dup [$ key1 ] = 1 ;
@@ -130,7 +139,7 @@ public function afterLoad($object)
130
139
}
131
140
132
141
/**
133
- * { @inheritdoc}
142
+ * @inheritdoc
134
143
* @SuppressWarnings(PHPMD.CyclomaticComplexity)
135
144
* @SuppressWarnings(PHPMD.NPathComplexity)
136
145
*/
@@ -170,7 +179,7 @@ public function afterSave($object)
170
179
}
171
180
172
181
/**
173
- * { @inheritdoc}
182
+ * @inheritdoc
174
183
*/
175
184
public function afterDelete ($ object )
176
185
{
@@ -179,7 +188,7 @@ public function afterDelete($object)
179
188
}
180
189
181
190
/**
182
- * { @inheritdoc}
191
+ * @inheritdoc
183
192
*/
184
193
public function getTable ()
185
194
{
@@ -193,4 +202,16 @@ public function getEntityIdField()
193
202
{
194
203
return $ this ->_attributeTax ->getIdFieldName ();
195
204
}
205
+
206
+ /**
207
+ * Don't need to change scope for tax.
208
+ *
209
+ * @param Attribute $attribute
210
+ * @return $this
211
+ * @SuppressWarnings(PHPMD.UnusedFormalParameter)
212
+ */
213
+ public function setScope ($ attribute )
214
+ {
215
+ return $ this ;
216
+ }
196
217
}
0 commit comments