File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
app/code/Magento/Eav/Model/Entity Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,11 @@ 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
+
40
45
/**
41
46
* Parameter name in event
42
47
*
@@ -299,9 +304,32 @@ public function beforeSave()
299
304
public function afterSave ()
300
305
{
301
306
$ this ->_getResource ()->saveInSetIncluding ($ this );
307
+ $ this ->getAttributeCache ()->clear ();
302
308
return parent ::afterSave ();
303
309
}
304
310
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
+
305
333
/**
306
334
* Detect backend storage type using frontend input type
307
335
*
You can’t perform that action at this time.
0 commit comments