I have a ProductFactory , it's construction must manual pass a parameter, But I don't know how to pass it. I use
$objectManager = \Magento\Framework\App\ObjectManager::getInstance();
$objectManager->get(ProductFeedCaptureFactory::class, ['instanceType' => $type]);
The ProductFactory code below:
class ProductFactory
{
/**
* Object Manager instance
*
* @var \Magento\Framework\ObjectManagerInterface
*/
protected $_objectManager = null;
/**
* Instance name to create
*
* @var string
*/
protected $_instanceName = null;
/**
* Factory constructor
*
* @param \Magento\Framework\ObjectManagerInterface $objectManager
* @param string $instanceType ftp、http、file
*
*/
public function __construct(\Magento\Framework\ObjectManagerInterface $objectManager, $instanceType )
{
}
}
But I got an exception :
Missing required argument $instanceType
How I fix it ? Thanks.