Skip to content

Commit a2da9c1

Browse files
author
Vladyslav Shcherbyna
committed
MAGETWO-38779: Stabilize story
1 parent 21ecf3b commit a2da9c1

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

app/code/Magento/Eav/Model/Entity/VersionControl/Metadata.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@ class Metadata extends \Magento\Framework\Model\Resource\Db\VersionControl\Metad
1818
*/
1919
public function getFields(\Magento\Framework\Object $entity)
2020
{
21-
if (!isset($this->metadataInfo[get_class($entity)])) {
21+
$entityClass = get_class($entity);
22+
if (!isset($this->metadataInfo[$entityClass])) {
2223
$fields = $entity->getResource()->getReadConnection()->describeTable(
2324
$entity->getResource()->getEntityTable()
2425
);
@@ -30,9 +31,9 @@ public function getFields(\Magento\Framework\Object $entity)
3031
null
3132
);
3233

33-
$this->metadataInfo[get_class($entity)] = $fields;
34+
$this->metadataInfo[$entityClass] = $fields;
3435
}
3536

36-
return $this->metadataInfo[get_class($entity)];
37+
return $this->metadataInfo[$entityClass];
3738
}
3839
}

lib/internal/Magento/Framework/Model/Resource/Db/VersionControl/Metadata.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,9 @@ class Metadata
2424
*/
2525
public function getFields(\Magento\Framework\Object $entity)
2626
{
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] =
2930
array_fill_keys(
3031
array_keys(
3132
$entity->getResource()->getReadConnection()->describeTable(
@@ -35,6 +36,6 @@ public function getFields(\Magento\Framework\Object $entity)
3536
null
3637
);
3738
}
38-
return $this->metadataInfo[get_class($entity)];
39+
return $this->metadataInfo[$entityClass];
3940
}
4041
}

lib/internal/Magento/Framework/Model/Resource/Db/VersionControl/Snapshot.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,11 @@ public function isModified(\Magento\Framework\Object $entity)
6060
return true;
6161
}
6262

63-
if (!isset($this->snapshotData[get_class($entity)][$entity->getId()])) {
63+
$entityClass = get_class($entity);
64+
if (!isset($this->snapshotData[$entityClass][$entity->getId()])) {
6465
return true;
6566
}
66-
foreach ($this->snapshotData[get_class($entity)][$entity->getId()] as $field => $value) {
67+
foreach ($this->snapshotData[$entityClass][$entity->getId()] as $field => $value) {
6768
if ($entity->getDataByKey($field) != $value) {
6869
return true;
6970
}

0 commit comments

Comments
 (0)