Skip to content

Commit d5d5b15

Browse files
author
Serhiy Shkolyarenko
committed
MAGETWO-32009: Catalog category model and tables cleaning
removed save() from AbstractResource
1 parent f80d186 commit d5d5b15

File tree

3 files changed

+2
-47
lines changed

3 files changed

+2
-47
lines changed

app/code/Magento/Catalog/Model/Resource/AbstractResource.php

Lines changed: 0 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -644,48 +644,4 @@ public function load($object, $entityId, $attributes = [])
644644
$this->_attributes = [];
645645
return parent::load($object, $entityId, $attributes);
646646
}
647-
648-
649-
/**
650-
* @param \Magento\Framework\Object $object
651-
* @return $this
652-
* @throws \Exception
653-
*/
654-
public function save(\Magento\Framework\Object $object)
655-
{
656-
/**
657-
* Direct deleted items to delete method
658-
*/
659-
if ($object->isDeleted()) {
660-
return $this->delete($object);
661-
}
662-
if (!$object->hasDataChanges()) {
663-
return $this;
664-
}
665-
$this->beginTransaction();
666-
try {
667-
$object->validateBeforeSave();
668-
$object->beforeSave();
669-
if ($object->isSaveAllowed()) {
670-
if (!$this->isPartialSave()) {
671-
$this->loadAllAttributes($object);
672-
}
673-
674-
$object->setParentId((int)$object->getParentId());
675-
676-
$this->_beforeSave($object);
677-
$this->_processSaveData($this->_collectSaveData($object));
678-
$this->_afterSave($object);
679-
680-
$object->afterSave();
681-
}
682-
$this->addCommitCallback([$object, 'afterCommitCallback'])->commit();
683-
$object->setHasDataChanges(false);
684-
} catch (\Exception $e) {
685-
$this->rollBack();
686-
$object->setHasDataChanges(true);
687-
throw $e;
688-
}
689-
return $this;
690-
}
691647
}

app/code/Magento/Catalog/Model/Resource/Product.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
*/
55
namespace Magento\Catalog\Model\Resource;
66

7-
use Magento\Eav\Model\Entity\Attribute\AbstractAttribute;
8-
97
/**
108
* Product entity resource model
119
*

app/code/Magento/Eav/Model/Entity/AbstractEntity.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1137,6 +1137,7 @@ protected function _setAttributeValue($object, $valueRow)
11371137
*
11381138
* @param \Magento\Framework\Object $object
11391139
* @return $this
1140+
* @throws \Exception
11401141
*/
11411142
public function save(\Magento\Framework\Object $object)
11421143
{
@@ -1158,7 +1159,7 @@ public function save(\Magento\Framework\Object $object)
11581159
$this->loadAllAttributes($object);
11591160
}
11601161

1161-
if (!$object->getEntityTypeId()) {
1162+
if (!$this->getEntityTable() && !$object->getEntityTypeId()) {
11621163
$object->setEntityTypeId($this->getTypeId());
11631164
}
11641165

0 commit comments

Comments
 (0)