Skip to content

Commit

Permalink
made use of proxies for the product export command to use it in unini…
Browse files Browse the repository at this point in the history
…tialized environments (like Magento automated testing)
  • Loading branch information
ma4nn committed Nov 10, 2021
1 parent b237d43 commit 795a144
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
15 changes: 2 additions & 13 deletions Console/Command/ProductExportCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,12 @@

class ProductExportCommand extends Command
{
/**
* @var \Recolize\RecommendationEngine\Model\Feed
*/
/** @var \Recolize\RecommendationEngine\Model\Feed */
private $feed;

/**
* @var \Magento\Framework\App\State
*/
/** @var \Magento\Framework\App\State */
private $state;

/**
* @param \Magento\Framework\App\State $state
* @param \Recolize\RecommendationEngine\Model\Feed $feed
*/
public function __construct(
\Magento\Framework\App\State $state,
\Recolize\RecommendationEngine\Model\Feed $feed
Expand All @@ -60,9 +52,6 @@ protected function configure()
/**
* Triggers the feed generation.
*
* @param \Symfony\Component\Console\Input\InputInterface $input
* @param \Symfony\Component\Console\Output\OutputInterface $output
*
* @return integer|null
*/
protected function execute(InputInterface $input, OutputInterface $output)
Expand Down
8 changes: 8 additions & 0 deletions etc/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,17 @@
<argument name="namespace" xsi:type="string">recolize</argument>
</arguments>
</virtualType>

<type name="Recolize\RecommendationEngine\Model\Session">
<arguments>
<argument name="storage" xsi:type="object">Recolize\RecommendationEngine\Model\Session\Storage</argument>
</arguments>
</type>

<type name="Recolize\RecommendationEngine\Console\Command\ProductExportCommand">
<arguments>
<argument name="state" xsi:type="object">Magento\Framework\App\State\Proxy</argument>
<argument name="feed" xsi:type="object">Recolize\RecommendationEngine\Model\Feed\Proxy</argument>
</arguments>
</type>
</config>

0 comments on commit 795a144

Please sign in to comment.