File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
app/code/Magento/CatalogInventory/Model/Source Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change 9
9
use Magento \CatalogInventory \Model \Stock as StockModel ;
10
10
use Magento \Eav \Model \Entity \Attribute \Source \AbstractSource ;
11
11
use Magento \Eav \Model \Entity \Collection \AbstractCollection ;
12
+ use Magento \Framework \App \ObjectManager ;
12
13
use Magento \Framework \Data \Collection ;
13
14
use Magento \Framework \EntityManager \MetadataPool ;
14
15
@@ -29,12 +30,12 @@ class Stock extends AbstractSource
29
30
private $ metadataPool ;
30
31
31
32
/**
32
- * @param MetadataPool $metadataPool
33
+ * @param MetadataPool|null $metadataPool
33
34
*/
34
35
public function __construct (
35
- MetadataPool $ metadataPool
36
+ MetadataPool $ metadataPool = null
36
37
) {
37
- $ this ->metadataPool = $ metadataPool ;
38
+ $ this ->metadataPool = $ metadataPool ?? ObjectManager:: getInstance ()-> get (MetadataPool::class) ;
38
39
}
39
40
40
41
/**
You can’t perform that action at this time.
0 commit comments