File tree Expand file tree Collapse file tree 3 files changed +22
-2
lines changed
Eav/Model/ResourceModel/Entity Expand file tree Collapse file tree 3 files changed +22
-2
lines changed Original file line number Diff line number Diff line change @@ -20,7 +20,7 @@ class CachedMetadata implements MetadataInterface
20
20
/**
21
21
* @var string
22
22
*/
23
- protected $ entityType = 'customer ' ;
23
+ protected $ entityType = 'none ' ;
24
24
25
25
/**
26
26
* @var AttributeCache
@@ -79,7 +79,7 @@ public function getAllAttributesMetadata()
79
79
if ($ attributes !== false ) {
80
80
return $ attributes ;
81
81
}
82
- $ attributes = $ this ->metadata ->getCustomAttributesMetadata ();
82
+ $ attributes = $ this ->metadata ->getAllAttributesMetadata ();
83
83
$ this ->getCache ()->saveAttributes ($ this ->entityType , $ attributes , 'all ' );
84
84
return $ attributes ;
85
85
}
Original file line number Diff line number Diff line change 13
13
*/
14
14
class CustomerCachedMetadata extends CachedMetadata implements CustomerMetadataInterface
15
15
{
16
+ protected $ entityType = 'customer ' ;
17
+
16
18
/**
17
19
* Initialize dependencies.
18
20
*
Original file line number Diff line number Diff line change 7
7
8
8
use Magento \Eav \Model \Entity \Attribute as EntityAttribute ;
9
9
use Magento \Eav \Model \Entity \Attribute \AbstractAttribute ;
10
+ use Magento \Eav \Model \Entity \AttributeCache ;
10
11
use Magento \Framework \DB \Select ;
11
12
use Magento \Framework \Model \AbstractModel ;
12
13
use Magento \Eav \Model \Config ;
@@ -41,6 +42,11 @@ class Attribute extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
41
42
*/
42
43
private $ config ;
43
44
45
+ /**
46
+ * @var AttributeCache
47
+ */
48
+ private $ attributeCache ;
49
+
44
50
/**
45
51
* Class constructor
46
52
*
@@ -204,9 +210,21 @@ protected function _afterSave(AbstractModel $object)
204
210
$ object
205
211
);
206
212
$ this ->getConfig ()->clear ();
213
+ $ this ->getAttributeCache ()->clear ();
207
214
return parent ::_afterSave ($ object );
208
215
}
209
216
217
+ /**
218
+ * @return AttributeCache
219
+ * @deprecated
220
+ */
221
+ private function getAttributeCache ()
222
+ {
223
+ if (!$ this ->attributeCache ) {
224
+ $ this ->attributeCache = ObjectManager::getInstance ()->get (Config::class);
225
+ }
226
+ return $ this ->attributeCache ;
227
+ }
210
228
/**
211
229
* @return Config
212
230
* @deprecated
You can’t perform that action at this time.
0 commit comments