From c1ce7c9d6f1b14c6b937a3b8da18810bd88dee1d Mon Sep 17 00:00:00 2001 From: James Date: Sat, 26 Dec 2020 15:38:01 +0000 Subject: [PATCH] working --- Command/TestCommand.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/Command/TestCommand.php b/Command/TestCommand.php index 9be8431..4146c04 100644 --- a/Command/TestCommand.php +++ b/Command/TestCommand.php @@ -6,6 +6,9 @@ use Symfony\Component\Console\Input\InputInterface; use Symfony\Component\Console\Output\OutputInterface; class TestCommand extends Command{ + /** + * {@inheritdoc} + */ private $_state; private $_objectManager; @@ -15,13 +18,14 @@ class TestCommand extends Command{ public function __construct( \Magento\Catalog\Model\ProductRepository $productRepository, \Magento\Framework\ObjectManagerInterface $objectManager, - \Magento\Framework\App\State $state, - \Magento\Catalog\Model\ResourceModel\Product\Action $productAction + \Magento\Framework\App\State $state//, + //\Magento\Catalog\Model\ResourceModel\Product\Action $productAction ) { $this->_state=$state; $this->_objectManager=$objectManager; $this->_productRepository=$productRepository; - $this->_productAction=$productAction; + //$this->_productAction=$productAction; + //$this->_productAction=$this->_objectManager->get('\Magento\Catalog\Model\ResourceModel\Product\Action'); parent::__construct(); } @@ -37,6 +41,7 @@ class TestCommand extends Command{ * {@inheritdoc} */ protected function execute(InputInterface $input, OutputInterface $output){ + $this->_productAction=$this->_objectManager->get('\Magento\Catalog\Model\ResourceModel\Product\Action'); $output->writeln(get_class($this->_productAction)); } }