File tree Expand file tree Collapse file tree 3 files changed +11
-8
lines changed
app/code/Magento/Eav/Model/Entity/VersionControl
lib/internal/Magento/Framework/Model/Resource/Db/VersionControl Expand file tree Collapse file tree 3 files changed +11
-8
lines changed Original file line number Diff line number Diff line change @@ -18,7 +18,8 @@ class Metadata extends \Magento\Framework\Model\Resource\Db\VersionControl\Metad
18
18
*/
19
19
public function getFields (\Magento \Framework \Object $ entity )
20
20
{
21
- if (!isset ($ this ->metadataInfo [get_class ($ entity )])) {
21
+ $ entityClass = get_class ($ entity );
22
+ if (!isset ($ this ->metadataInfo [$ entityClass ])) {
22
23
$ fields = $ entity ->getResource ()->getReadConnection ()->describeTable (
23
24
$ entity ->getResource ()->getEntityTable ()
24
25
);
@@ -30,9 +31,9 @@ public function getFields(\Magento\Framework\Object $entity)
30
31
null
31
32
);
32
33
33
- $ this ->metadataInfo [get_class ( $ entity ) ] = $ fields ;
34
+ $ this ->metadataInfo [$ entityClass ] = $ fields ;
34
35
}
35
36
36
- return $ this ->metadataInfo [get_class ( $ entity ) ];
37
+ return $ this ->metadataInfo [$ entityClass ];
37
38
}
38
39
}
Original file line number Diff line number Diff line change @@ -24,8 +24,9 @@ class Metadata
24
24
*/
25
25
public function getFields (\Magento \Framework \Object $ entity )
26
26
{
27
- if (!isset ($ this ->metadataInfo [get_class ($ entity )])) {
28
- $ this ->metadataInfo [get_class ($ entity )] =
27
+ $ entityClass = get_class ($ entity );
28
+ if (!isset ($ this ->metadataInfo [$ entityClass ])) {
29
+ $ this ->metadataInfo [$ entityClass ] =
29
30
array_fill_keys (
30
31
array_keys (
31
32
$ entity ->getResource ()->getReadConnection ()->describeTable (
@@ -35,6 +36,6 @@ public function getFields(\Magento\Framework\Object $entity)
35
36
null
36
37
);
37
38
}
38
- return $ this ->metadataInfo [get_class ( $ entity ) ];
39
+ return $ this ->metadataInfo [$ entityClass ];
39
40
}
40
41
}
Original file line number Diff line number Diff line change @@ -60,10 +60,11 @@ public function isModified(\Magento\Framework\Object $entity)
60
60
return true ;
61
61
}
62
62
63
- if (!isset ($ this ->snapshotData [get_class ($ entity )][$ entity ->getId ()])) {
63
+ $ entityClass = get_class ($ entity );
64
+ if (!isset ($ this ->snapshotData [$ entityClass ][$ entity ->getId ()])) {
64
65
return true ;
65
66
}
66
- foreach ($ this ->snapshotData [get_class ( $ entity ) ][$ entity ->getId ()] as $ field => $ value ) {
67
+ foreach ($ this ->snapshotData [$ entityClass ][$ entity ->getId ()] as $ field => $ value ) {
67
68
if ($ entity ->getDataByKey ($ field ) != $ value ) {
68
69
return true ;
69
70
}
You can’t perform that action at this time.
0 commit comments