Skip to content

Commit ec2c129

Browse files
author
Olga Kopylova
committed
Merge remote-tracking branch 'mainline/develop' into PR_Branch
2 parents c082eed + c7c7967 commit ec2c129

File tree

100 files changed

+2654
-1293
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

100 files changed

+2654
-1293
lines changed

app/code/Magento/Backend/Block/Widget/Button/Item.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,25 @@
1616
*/
1717
class Item extends \Magento\Framework\Object
1818
{
19+
/**
20+
* Object delete flag
21+
*
22+
* @var bool
23+
*/
24+
protected $_isDeleted = false;
25+
26+
/**
27+
* Set _isDeleted flag value (if $isDeleted parameter is defined) and return current flag value
28+
*
29+
* @param boolean $isDeleted
30+
* @return bool
31+
*/
32+
public function isDeleted($isDeleted = null)
33+
{
34+
$result = $this->_isDeleted;
35+
if ($isDeleted !== null) {
36+
$this->_isDeleted = $isDeleted;
37+
}
38+
return $result;
39+
}
1940
}

app/code/Magento/Backup/Model/Resource/Db.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,6 @@ public function getTableStatus($tableName)
124124

125125
if ($row) {
126126
$statusObject = new \Magento\Framework\Object();
127-
$statusObject->setIdFieldName('name');
128127
foreach ($row as $field => $value) {
129128
$statusObject->setData(strtolower($field), $value);
130129
}

app/code/Magento/Bundle/Model/Option.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,10 @@ protected function _construct()
5353
*/
5454
public function addSelection(\Magento\Catalog\Model\Product $selection)
5555
{
56-
$selections = $this->getDataSetDefault('selections', []);
56+
if (!$this->hasData('selections')) {
57+
$this->setData('selections', []);
58+
}
59+
$selections = $this->getData('selections');
5760
$selections[] = $selection;
5861
$this->setSelections($selections);
5962
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ public function __construct(
4949
) {
5050
$this->_eavEntityAttribute = $eavEntityAttribute;
5151
parent::__construct($data);
52-
$this->setIdFieldName('visibility_id');
5352
}
5453

5554
/**

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ protected function _construct()
4040
public function updateAttributes($entityIds, $attrData, $storeId)
4141
{
4242
$object = new \Magento\Framework\Object();
43-
$object->setIdFieldName('entity_id')->setStoreId($storeId);
43+
$object->setStoreId($storeId);
4444

4545
$this->_getWriteAdapter()->beginTransaction();
4646
try {
@@ -54,6 +54,7 @@ public function updateAttributes($entityIds, $attrData, $storeId)
5454
foreach ($entityIds as $entityId) {
5555
$i++;
5656
$object->setId($entityId);
57+
$object->setEntityId($entityId);
5758
// collect data for save
5859
$this->_saveAttributeValue($object, $attribute, $value);
5960
// save collected data every 1000 rows

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,8 @@ protected function _getCategories($categoryIds, $storeId = null, $path = null)
432432
}
433433

434434
$category = new \Magento\Framework\Object($row);
435-
$category->setIdFieldName('entity_id');
435+
$category->setId($row['entity_id']);
436+
$category->setEntityId($row['entity_id']);
436437
$category->setStoreId($storeId);
437438
$this->_prepareCategoryParentId($category);
438439

@@ -535,7 +536,8 @@ protected function _getProducts($productIds, $storeId, $entityId, &$lastEntityId
535536
$rowSet = $adapter->fetchAll($select, $bind);
536537
foreach ($rowSet as $row) {
537538
$product = new \Magento\Framework\Object($row);
538-
$product->setIdFieldName('entity_id');
539+
$product->setId($row['entity_id']);
540+
$product->setEntityId($row['entity_id']);
539541
$product->setCategoryIds([]);
540542
$product->setStoreId($storeId);
541543
$products[$product->getId()] = $product;

app/code/Magento/CatalogSearch/Model/Indexer/Fulltext/Action/Full.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -627,7 +627,7 @@ protected function getProductEmulator($typeId)
627627
{
628628
if (!isset($this->productEmulators[$typeId])) {
629629
$productEmulator = new \Magento\Framework\Object();
630-
$productEmulator->setIdFieldName('entity_id')->setTypeId($typeId);
630+
$productEmulator->setTypeId($typeId);
631631
$this->productEmulators[$typeId] = $productEmulator;
632632
}
633633
return $this->productEmulators[$typeId];

app/code/Magento/CatalogUrlRewrite/Model/CategoryUrlPathGenerator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ public function __construct(
5656
/**
5757
* Build category URL path
5858
*
59-
* @param \Magento\Catalog\Api\Data\CategoryInterface|\Magento\Framework\Object $category
59+
* @param \Magento\Catalog\Api\Data\CategoryInterface|\Magento\Framework\Model\AbstractModel $category
6060
* @return string
6161
*/
6262
public function getUrlPath($category)

app/code/Magento/CatalogUrlRewrite/Test/Unit/Model/ObjectRegistryTest.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ class ObjectRegistryTest extends \PHPUnit_Framework_TestCase
1818

1919
protected function setUp()
2020
{
21-
$this->object = $this->getMock('Magento\Framework\Object');
22-
$this->object->expects($this->any())->method('getId')->will($this->returnValue(1));
21+
$this->object = new \Magento\Framework\Object(['id' => 1]);
2322
$this->objectRegistry = (new ObjectManager($this))->getObject(
2423
'Magento\CatalogUrlRewrite\Model\ObjectRegistry',
2524
['entities' => [$this->object]]

app/code/Magento/Checkout/Model/Cart.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -501,9 +501,7 @@ public function updateItems($data)
501501
if ($qty > 0) {
502502
$item->setQty($qty);
503503

504-
$itemInQuote = $this->getQuote()->getItemById($item->getId());
505-
506-
if (!$itemInQuote && $item->getHasError()) {
504+
if ($item->getHasError()) {
507505
throw new \Magento\Framework\Exception\LocalizedException(__($item->getMessage()));
508506
}
509507

@@ -527,6 +525,7 @@ public function updateItems($data)
527525
'checkout_cart_update_items_after',
528526
['cart' => $this, 'info' => $infoDataObject]
529527
);
528+
530529
return $this;
531530
}
532531

0 commit comments

Comments
 (0)