Skip to content

Commit 0df9642

Browse files
committed
B2B-2404: Optimize Product Permissions in GraphQL resolver
1 parent d99e9e4 commit 0df9642

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

app/code/Magento/Catalog/Model/ResourceModel/Product/ChildCollectionFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ class ChildCollectionFactory extends CollectionFactory
2020
*/
2121
public function create(array $data = [])
2222
{
23-
$collection = $this->_objectManager->create($this->_instanceName, $data);
23+
$collection = parent::create($data);
2424
$collection->setFlag('product_children', true);
2525
return $collection;
2626
}

app/code/Magento/Catalog/Model/ResourceModel/Product/CollectionFactory.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,14 @@ class CollectionFactory
1717
*
1818
* @var \Magento\Framework\ObjectManagerInterface
1919
*/
20-
protected $_objectManager = null;
20+
private $objectManager = null;
2121

2222
/**
2323
* Instance name to create
2424
*
2525
* @var string
2626
*/
27-
protected $_instanceName = null;
27+
private $instanceName = null;
2828

2929
/**
3030
* Factory constructor
@@ -36,8 +36,8 @@ public function __construct(
3636
\Magento\Framework\ObjectManagerInterface $objectManager,
3737
$instanceName = Collection::class
3838
) {
39-
$this->_objectManager = $objectManager;
40-
$this->_instanceName = $instanceName;
39+
$this->objectManager = $objectManager;
40+
$this->instanceName = $instanceName;
4141
}
4242

4343
/**
@@ -48,6 +48,6 @@ public function __construct(
4848
*/
4949
public function create(array $data = [])
5050
{
51-
return $this->_objectManager->create($this->_instanceName, $data);
51+
return $this->objectManager->create($this->instanceName, $data);
5252
}
5353
}

0 commit comments

Comments
 (0)