@@ -37,11 +37,6 @@ class Attribute extends \Magento\Eav\Model\Entity\Attribute\AbstractAttribute im
37
37
*/
38
38
protected $ _eventPrefix = 'eav_entity_attribute ' ;
39
39
40
- /**
41
- * @var AttributeCache
42
- */
43
- private $ attributeCache ;
44
-
45
40
/**
46
41
* Parameter name in event
47
42
*
@@ -227,7 +222,7 @@ public function loadEntityAttributeIdBySet()
227
222
public function beforeSave ()
228
223
{
229
224
// prevent overriding product data
230
- if (isset ($ this ->_data ['attribute_code ' ]) && $ this ->getReservedAttributeList () ->isReservedAttribute ($ this )) {
225
+ if (isset ($ this ->_data ['attribute_code ' ]) && $ this ->reservedAttributeList ->isReservedAttribute ($ this )) {
231
226
throw new LocalizedException (
232
227
__ (
233
228
'The attribute code \'%1 \' is reserved by system. Please try another attribute code ' ,
@@ -304,32 +299,9 @@ public function beforeSave()
304
299
public function afterSave ()
305
300
{
306
301
$ this ->_getResource ()->saveInSetIncluding ($ this );
307
- $ this ->getAttributeCache ()->clear ();
308
302
return parent ::afterSave ();
309
303
}
310
304
311
- /**
312
- * @return $this
313
- */
314
- public function afterDelete ()
315
- {
316
- $ this ->getAttributeCache ()->clear ();
317
- return parent ::afterDelete ();
318
- }
319
-
320
- /**
321
- * Attribute cache
322
- *
323
- * @return AttributeCache
324
- */
325
- private function getAttributeCache ()
326
- {
327
- if (!$ this ->attributeCache ) {
328
- $ this ->attributeCache = ObjectManager::getInstance ()->get (AttributeCache::class);
329
- }
330
- return $ this ->attributeCache ;
331
- }
332
-
333
305
/**
334
306
* Detect backend storage type using frontend input type
335
307
*
@@ -512,22 +484,8 @@ public function __wakeup()
512
484
parent ::__wakeup ();
513
485
$ objectManager = \Magento \Framework \App \ObjectManager::getInstance ();
514
486
$ this ->_localeDate = $ objectManager ->get (\Magento \Framework \Stdlib \DateTime \TimezoneInterface::class);
515
- $ this ->_localeResolver = $ objectManager ->get (\Magento \Catalog \ Model \ Product \ReservedAttributeList ::class);
516
- $ this ->reservedAttributeList = $ objectManager ->get (\Magento \Framework \ Locale \ResolverInterface ::class);
487
+ $ this ->_localeResolver = $ objectManager ->get (\Magento \Framework \ Locale \ResolverInterface ::class);
488
+ $ this ->reservedAttributeList = $ objectManager ->get (\Magento \Catalog \ Model \ Product \ReservedAttributeList ::class);
517
489
$ this ->dateTimeFormatter = $ objectManager ->get (DateTimeFormatterInterface::class);
518
490
}
519
-
520
- /**
521
- * @return \Magento\Catalog\Model\Product\ReservedAttributeList|mixed
522
- */
523
- private function getReservedAttributeList ()
524
- {
525
- if ($ this ->reservedAttributeList ) {
526
- $ this ->reservedAttributeList = \Magento \Framework \App \ObjectManager::getInstance ()->get (
527
- \Magento \Catalog \Model \Product \ReservedAttributeList::class
528
- );
529
- }
530
-
531
- return $ this ->reservedAttributeList ;
532
- }
533
491
}
0 commit comments