Skip to content

Commit 2d94c94

Browse files
[EngCom] Public Pull Requests - 2.2-develop
- merged latest code from mainline branch
2 parents 847f182 + 9efa5e1 commit 2d94c94

File tree

9 files changed

+259
-144
lines changed

9 files changed

+259
-144
lines changed

app/code/Magento/Catalog/Model/Category/Attribute.php

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,15 @@ class Attribute extends \Magento\Catalog\Model\Entity\Attribute implements
2929
*/
3030
public function getApplyTo()
3131
{
32-
if ($this->getData(self::APPLY_TO)) {
33-
if (is_array($this->getData(self::APPLY_TO))) {
34-
return $this->getData(self::APPLY_TO);
32+
$applyTo = $this->_getData(self::APPLY_TO);
33+
if ($applyTo) {
34+
if (is_array($applyTo)) {
35+
return $applyTo;
3536
}
36-
return explode(',', $this->getData(self::APPLY_TO));
37-
} else {
38-
return [];
37+
return explode(',', $applyTo);
3938
}
39+
40+
return [];
4041
}
4142

4243
/**
@@ -59,7 +60,7 @@ public function setApplyTo($applyTo)
5960
*/
6061
public function getIsWysiwygEnabled()
6162
{
62-
return $this->getData(self::IS_WYSIWYG_ENABLED);
63+
return $this->_getData(self::IS_WYSIWYG_ENABLED);
6364
}
6465

6566
/**
@@ -70,15 +71,15 @@ public function getIsWysiwygEnabled()
7071
*/
7172
public function setIsWysiwygEnabled($isWysiwygEnabled)
7273
{
73-
return $this->getData(self::IS_WYSIWYG_ENABLED, $isWysiwygEnabled);
74+
return $this->setData(self::IS_WYSIWYG_ENABLED, $isWysiwygEnabled);
7475
}
7576

7677
/**
7778
* {@inheritdoc}
7879
*/
7980
public function getIsHtmlAllowedOnFront()
8081
{
81-
return $this->getData(self::IS_HTML_ALLOWED_ON_FRONT);
82+
return $this->_getData(self::IS_HTML_ALLOWED_ON_FRONT);
8283
}
8384

8485
/**
@@ -97,7 +98,7 @@ public function setIsHtmlAllowedOnFront($isHtmlAllowedOnFront)
9798
*/
9899
public function getUsedForSortBy()
99100
{
100-
return $this->getData(self::USED_FOR_SORT_BY);
101+
return $this->_getData(self::USED_FOR_SORT_BY);
101102
}
102103

103104
/**
@@ -116,7 +117,7 @@ public function setUsedForSortBy($usedForSortBy)
116117
*/
117118
public function getIsFilterable()
118119
{
119-
return $this->getData(self::IS_FILTERABLE);
120+
return $this->_getData(self::IS_FILTERABLE);
120121
}
121122

122123
/**
@@ -135,31 +136,31 @@ public function setIsFilterable($isFilterable)
135136
*/
136137
public function getIsFilterableInSearch()
137138
{
138-
return $this->getData(self::IS_FILTERABLE_IN_SEARCH);
139+
return $this->_getData(self::IS_FILTERABLE_IN_SEARCH);
139140
}
140141

141142
/**
142143
* {@inheritdoc}
143144
*/
144145
public function getIsUsedInGrid()
145146
{
146-
return (bool)$this->getData(self::IS_USED_IN_GRID);
147+
return (bool)$this->_getData(self::IS_USED_IN_GRID);
147148
}
148149

149150
/**
150151
* {@inheritdoc}
151152
*/
152153
public function getIsVisibleInGrid()
153154
{
154-
return (bool)$this->getData(self::IS_VISIBLE_IN_GRID);
155+
return (bool)$this->_getData(self::IS_VISIBLE_IN_GRID);
155156
}
156157

157158
/**
158159
* {@inheritdoc}
159160
*/
160161
public function getIsFilterableInGrid()
161162
{
162-
return (bool)$this->getData(self::IS_FILTERABLE_IN_GRID);
163+
return (bool)$this->_getData(self::IS_FILTERABLE_IN_GRID);
163164
}
164165

165166
/**
@@ -170,15 +171,15 @@ public function getIsFilterableInGrid()
170171
*/
171172
public function setIsFilterableInSearch($isFilterableInSearch)
172173
{
173-
return $this->getData(self::IS_FILTERABLE_IN_SEARCH, $isFilterableInSearch);
174+
return $this->setData(self::IS_FILTERABLE_IN_SEARCH, $isFilterableInSearch);
174175
}
175176

176177
/**
177178
* {@inheritdoc}
178179
*/
179180
public function getPosition()
180181
{
181-
return $this->getData(self::POSITION);
182+
return $this->_getData(self::POSITION);
182183
}
183184

184185
/**
@@ -197,7 +198,7 @@ public function setPosition($position)
197198
*/
198199
public function getIsSearchable()
199200
{
200-
return $this->getData(self::IS_SEARCHABLE);
201+
return $this->_getData(self::IS_SEARCHABLE);
201202
}
202203

203204
/**
@@ -216,7 +217,7 @@ public function setIsSearchable($isSearchable)
216217
*/
217218
public function getIsVisibleInAdvancedSearch()
218219
{
219-
return $this->getData(self::IS_VISIBLE_IN_ADVANCED_SEARCH);
220+
return $this->_getData(self::IS_VISIBLE_IN_ADVANCED_SEARCH);
220221
}
221222

222223
/**
@@ -235,7 +236,7 @@ public function setIsVisibleInAdvancedSearch($isVisibleInAdvancedSearch)
235236
*/
236237
public function getIsComparable()
237238
{
238-
return $this->getData(self::IS_COMPARABLE);
239+
return $this->_getData(self::IS_COMPARABLE);
239240
}
240241

241242
/**
@@ -254,7 +255,7 @@ public function setIsComparable($isComparable)
254255
*/
255256
public function getIsUsedForPromoRules()
256257
{
257-
return $this->getData(self::IS_USED_FOR_PROMO_RULES);
258+
return $this->_getData(self::IS_USED_FOR_PROMO_RULES);
258259
}
259260

260261
/**
@@ -273,7 +274,7 @@ public function setIsUsedForPromoRules($isUsedForPromoRules)
273274
*/
274275
public function getIsVisibleOnFront()
275276
{
276-
return $this->getData(self::IS_VISIBLE_ON_FRONT);
277+
return $this->_getData(self::IS_VISIBLE_ON_FRONT);
277278
}
278279

279280
/**
@@ -292,7 +293,7 @@ public function setIsVisibleOnFront($isVisibleOnFront)
292293
*/
293294
public function getUsedInProductListing()
294295
{
295-
return $this->getData(self::USED_IN_PRODUCT_LISTING);
296+
return $this->_getData(self::USED_IN_PRODUCT_LISTING);
296297
}
297298

298299
/**
@@ -311,7 +312,7 @@ public function setUsedInProductListing($usedInProductListing)
311312
*/
312313
public function getIsVisible()
313314
{
314-
return $this->getData(self::IS_VISIBLE);
315+
return $this->_getData(self::IS_VISIBLE);
315316
}
316317

317318
/**
@@ -332,7 +333,7 @@ public function setIsVisible($isVisible)
332333
*/
333334
public function getScope()
334335
{
335-
$scope = $this->getData(self::KEY_IS_GLOBAL);
336+
$scope = $this->_getData(self::KEY_IS_GLOBAL);
336337
if ($scope == self::SCOPE_GLOBAL) {
337338
return self::SCOPE_GLOBAL_TEXT;
338339
} elseif ($scope == self::SCOPE_WEBSITE) {

app/code/Magento/Catalog/Model/ResourceModel/Eav/Attribute.php

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -239,11 +239,11 @@ public function afterSave()
239239
*/
240240
protected function _isEnabledInFlat()
241241
{
242-
return $this->getData('backend_type') == 'static'
242+
return $this->_getData('backend_type') == 'static'
243243
|| $this->_productFlatIndexerHelper->isAddFilterableAttributes()
244-
&& $this->getData('is_filterable') > 0
245-
|| $this->getData('used_in_product_listing') == 1
246-
|| $this->getData('used_for_sort_by') == 1;
244+
&& $this->_getData('is_filterable') > 0
245+
|| $this->_getData('used_in_product_listing') == 1
246+
|| $this->_getData('used_for_sort_by') == 1;
247247
}
248248

249249
/**
@@ -341,7 +341,7 @@ public function getStoreId()
341341
if ($dataObject) {
342342
return $dataObject->getStoreId();
343343
}
344-
return $this->getData('store_id');
344+
return $this->_getData('store_id');
345345
}
346346

347347
/**
@@ -366,7 +366,7 @@ public function getApplyTo()
366366
*/
367367
public function getSourceModel()
368368
{
369-
$model = $this->getData('source_model');
369+
$model = $this->_getData('source_model');
370370
if (empty($model)) {
371371
if ($this->getBackendType() == 'int' && $this->getFrontendInput() == 'select') {
372372
return $this->_getDefaultSourceModel();
@@ -496,127 +496,127 @@ public function getIndexType()
496496
*/
497497
public function getIsWysiwygEnabled()
498498
{
499-
return $this->getData(self::IS_WYSIWYG_ENABLED);
499+
return $this->_getData(self::IS_WYSIWYG_ENABLED);
500500
}
501501

502502
/**
503503
* {@inheritdoc}
504504
*/
505505
public function getIsHtmlAllowedOnFront()
506506
{
507-
return $this->getData(self::IS_HTML_ALLOWED_ON_FRONT);
507+
return $this->_getData(self::IS_HTML_ALLOWED_ON_FRONT);
508508
}
509509

510510
/**
511511
* {@inheritdoc}
512512
*/
513513
public function getUsedForSortBy()
514514
{
515-
return $this->getData(self::USED_FOR_SORT_BY);
515+
return $this->_getData(self::USED_FOR_SORT_BY);
516516
}
517517

518518
/**
519519
* {@inheritdoc}
520520
*/
521521
public function getIsFilterable()
522522
{
523-
return $this->getData(self::IS_FILTERABLE);
523+
return $this->_getData(self::IS_FILTERABLE);
524524
}
525525

526526
/**
527527
* {@inheritdoc}
528528
*/
529529
public function getIsFilterableInSearch()
530530
{
531-
return $this->getData(self::IS_FILTERABLE_IN_SEARCH);
531+
return $this->_getData(self::IS_FILTERABLE_IN_SEARCH);
532532
}
533533

534534
/**
535535
* {@inheritdoc}
536536
*/
537537
public function getIsUsedInGrid()
538538
{
539-
return (bool)$this->getData(self::IS_USED_IN_GRID);
539+
return (bool)$this->_getData(self::IS_USED_IN_GRID);
540540
}
541541

542542
/**
543543
* {@inheritdoc}
544544
*/
545545
public function getIsVisibleInGrid()
546546
{
547-
return (bool)$this->getData(self::IS_VISIBLE_IN_GRID);
547+
return (bool)$this->_getData(self::IS_VISIBLE_IN_GRID);
548548
}
549549

550550
/**
551551
* {@inheritdoc}
552552
*/
553553
public function getIsFilterableInGrid()
554554
{
555-
return (bool)$this->getData(self::IS_FILTERABLE_IN_GRID);
555+
return (bool)$this->_getData(self::IS_FILTERABLE_IN_GRID);
556556
}
557557

558558
/**
559559
* {@inheritdoc}
560560
*/
561561
public function getPosition()
562562
{
563-
return $this->getData(self::POSITION);
563+
return $this->_getData(self::POSITION);
564564
}
565565

566566
/**
567567
* {@inheritdoc}
568568
*/
569569
public function getIsSearchable()
570570
{
571-
return $this->getData(self::IS_SEARCHABLE);
571+
return $this->_getData(self::IS_SEARCHABLE);
572572
}
573573

574574
/**
575575
* {@inheritdoc}
576576
*/
577577
public function getIsVisibleInAdvancedSearch()
578578
{
579-
return $this->getData(self::IS_VISIBLE_IN_ADVANCED_SEARCH);
579+
return $this->_getData(self::IS_VISIBLE_IN_ADVANCED_SEARCH);
580580
}
581581

582582
/**
583583
* {@inheritdoc}
584584
*/
585585
public function getIsComparable()
586586
{
587-
return $this->getData(self::IS_COMPARABLE);
587+
return $this->_getData(self::IS_COMPARABLE);
588588
}
589589

590590
/**
591591
* {@inheritdoc}
592592
*/
593593
public function getIsUsedForPromoRules()
594594
{
595-
return $this->getData(self::IS_USED_FOR_PROMO_RULES);
595+
return $this->_getData(self::IS_USED_FOR_PROMO_RULES);
596596
}
597597

598598
/**
599599
* {@inheritdoc}
600600
*/
601601
public function getIsVisibleOnFront()
602602
{
603-
return $this->getData(self::IS_VISIBLE_ON_FRONT);
603+
return $this->_getData(self::IS_VISIBLE_ON_FRONT);
604604
}
605605

606606
/**
607607
* {@inheritdoc}
608608
*/
609609
public function getUsedInProductListing()
610610
{
611-
return $this->getData(self::USED_IN_PRODUCT_LISTING);
611+
return $this->_getData(self::USED_IN_PRODUCT_LISTING);
612612
}
613613

614614
/**
615615
* {@inheritdoc}
616616
*/
617617
public function getIsVisible()
618618
{
619-
return $this->getData(self::IS_VISIBLE);
619+
return $this->_getData(self::IS_VISIBLE);
620620
}
621621

622622
//@codeCoverageIgnoreEnd

0 commit comments

Comments
 (0)