Skip to content

Commit

Permalink
fix serialization
Browse files Browse the repository at this point in the history
  • Loading branch information
Bashev committed Jan 20, 2021
1 parent 2bd32e3 commit 20059e7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
12 changes: 6 additions & 6 deletions Helper/Data.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Magento\Framework\App\Helper\AbstractHelper;
use Magento\Framework\App\Helper\Context;
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Unserialize\Unserialize;
use Magento\Framework\Serialize\Serializer\Json;
use Magento\Framework\UrlInterface;
use Magento\Framework\Xml\Parser;
use Magento\Store\Api\Data\StoreInterface;
Expand Down Expand Up @@ -60,9 +60,9 @@ class Data extends AbstractHelper
private $categoryRepository;

/**
* @var Unserialize;
* @var \Magento\Framework\Serialize\Serializer\Json
*/
private $unserialize;
private $json;

/**
* @var Parser
Expand Down Expand Up @@ -93,14 +93,14 @@ public function __construct(
CategoryRepositoryInterface $categoryRepository,
StoreManagerInterface $storeManager,
Parser $parser,
Unserialize $unserialize,
Json $json,
DirectoryList $directoryList,
Context $context
) {
$this->categoryRepository = $categoryRepository;
$this->storeManager = $storeManager;
$this->parser = $parser;
$this->unserialize = $unserialize;
$this->json = $json;
$this->directoryList = $directoryList;
parent::__construct($context);
}
Expand Down Expand Up @@ -324,7 +324,7 @@ public function getGlamiCategory(array $productCategories)
$this->logger($e->getMessage());
}

if ($categories = $this->unserialize->unserialize($categoriesConfigData)) {
if ($categories = $this->json->unserialize($categoriesConfigData)) {
foreach ($categories as $category) {
if (!empty($category['target']) && \in_array($category['source_id'], $productCategories, true)) {
$glamiCategoryIds[] = $category['target'];
Expand Down
3 changes: 0 additions & 3 deletions Service/GenerateFeed.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,6 @@
use Magento\Framework\Exception\NoSuchEntityException;
use Magento\Framework\Filesystem\Io\File;
use Magento\Framework\Simplexml\Element;
use Magento\InventorySalesApi\Api\AreProductsSalableInterface;
use Magento\InventorySalesApi\Api\Data\SalesChannelInterface;
use Magento\InventorySalesApi\Api\StockResolverInterface;
use Magento\Store\Api\Data\StoreInterface;
use Magento\Store\Model\StoreManagerInterface;
use Symfony\Component\Console\Helper\ProgressBar;
Expand Down

0 comments on commit 20059e7

Please sign in to comment.