3
3
* Copyright © Magento, Inc. All rights reserved.
4
4
* See COPYING.txt for license details.
5
5
*/
6
+ declare (strict_types=1 );
7
+
6
8
namespace Magento \Bundle \Block \Adminhtml \Catalog \Product \Edit \Tab \Bundle ;
7
9
8
10
use Magento \Framework \Data \Form \Element \AbstractElement ;
11
+ use Magento \Store \Model \Store ;
9
12
13
+ /**
14
+ * Block for rendering option of bundle product
15
+ *
16
+ * Class \Magento\Bundle\Block\Adminhtml\Catalog\Product\Edit\Tab\Bundle\Option
17
+ */
10
18
class Option extends \Magento \Backend \Block \Widget
11
19
{
12
20
/**
@@ -79,6 +87,8 @@ protected function _construct()
79
87
}
80
88
81
89
/**
90
+ * Return Field Id
91
+ *
82
92
* @return string
83
93
*/
84
94
public function getFieldId ()
@@ -87,6 +97,8 @@ public function getFieldId()
87
97
}
88
98
89
99
/**
100
+ * Return Field Name
101
+ *
90
102
* @return string
91
103
*/
92
104
public function getFieldName ()
@@ -108,6 +120,8 @@ public function getProduct()
108
120
}
109
121
110
122
/**
123
+ * Render
124
+ *
111
125
* @param AbstractElement $element
112
126
* @return string
113
127
*/
@@ -118,6 +132,8 @@ public function render(AbstractElement $element)
118
132
}
119
133
120
134
/**
135
+ * Set Element
136
+ *
121
137
* @param AbstractElement $element
122
138
* @return $this
123
139
*/
@@ -128,6 +144,8 @@ public function setElement(AbstractElement $element)
128
144
}
129
145
130
146
/**
147
+ * Get Element
148
+ *
131
149
* @return AbstractElement|null
132
150
*/
133
151
public function getElement ()
@@ -136,6 +154,8 @@ public function getElement()
136
154
}
137
155
138
156
/**
157
+ * Return Is Multi Websites
158
+ *
139
159
* @return bool
140
160
*/
141
161
public function isMultiWebsites ()
@@ -144,6 +164,8 @@ public function isMultiWebsites()
144
164
}
145
165
146
166
/**
167
+ * Prepare Layout
168
+ *
147
169
* @return $this
148
170
*/
149
171
protected function _prepareLayout ()
@@ -184,6 +206,8 @@ protected function _prepareLayout()
184
206
}
185
207
186
208
/**
209
+ * Get Add Button Html
210
+ *
187
211
* @return string
188
212
*/
189
213
public function getAddButtonHtml ()
@@ -192,6 +216,8 @@ public function getAddButtonHtml()
192
216
}
193
217
194
218
/**
219
+ * Get Close Search Button Html
220
+ *
195
221
* @return string
196
222
*/
197
223
public function getCloseSearchButtonHtml ()
@@ -200,6 +226,8 @@ public function getCloseSearchButtonHtml()
200
226
}
201
227
202
228
/**
229
+ * Get Add Selection Button Html
230
+ *
203
231
* @return string
204
232
*/
205
233
public function getAddSelectionButtonHtml ()
@@ -239,6 +267,8 @@ public function getOptions()
239
267
}
240
268
241
269
/**
270
+ * Get Add Button Id
271
+ *
242
272
* @return mixed
243
273
*/
244
274
public function getAddButtonId ()
@@ -248,6 +278,8 @@ public function getAddButtonId()
248
278
}
249
279
250
280
/**
281
+ * Get Options Delete Button Html
282
+ *
251
283
* @return string
252
284
*/
253
285
public function getOptionDeleteButtonHtml ()
@@ -256,6 +288,8 @@ public function getOptionDeleteButtonHtml()
256
288
}
257
289
258
290
/**
291
+ * Get Selection Html
292
+ *
259
293
* @return string
260
294
*/
261
295
public function getSelectionHtml ()
@@ -264,6 +298,8 @@ public function getSelectionHtml()
264
298
}
265
299
266
300
/**
301
+ * Get Type Select Html
302
+ *
267
303
* @return mixed
268
304
*/
269
305
public function getTypeSelectHtml ()
@@ -286,6 +322,8 @@ public function getTypeSelectHtml()
286
322
}
287
323
288
324
/**
325
+ * Get Require Select Html
326
+ *
289
327
* @return mixed
290
328
*/
291
329
public function getRequireSelectHtml ()
@@ -304,10 +342,12 @@ public function getRequireSelectHtml()
304
342
}
305
343
306
344
/**
345
+ * Return Is Default Store
346
+ *
307
347
* @return bool
308
348
*/
309
349
public function isDefaultStore ()
310
350
{
311
- return $ this ->getProduct ()->getStoreId () == ' 0 ' ;
351
+ return $ this ->getProduct ()->getStoreId () == Store:: DEFAULT_STORE_ID ;
312
352
}
313
353
}
0 commit comments