Find this useful? Enter your email to receive occasional updates for securing PHP code.
Signing you up...
Thank you for signing up!
PHP Decode
<?php /** * Copyright Magento, Inc. All rights reserved. * See COPYING.txt for license ..
Decoded Output download
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Block\Product\ProductList;
use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
class Promotion extends \Magento\Catalog\Block\Product\ListProduct
{
/**
* Product collection factory
*
* @var CollectionFactory
*/
protected $_productCollectionFactory;
/**
* @var CategoryRepositoryInterface
*/
protected $categoryRepository;
/**
* @param \Magento\Catalog\Block\Product\Context $context
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
* @param CategoryRepositoryInterface $categoryRepository
* @param \Magento\Framework\Url\Helper\Data $urlHelper
* @param CollectionFactory $productCollectionFactory
* @param array $data
*/
public function __construct(
\Magento\Catalog\Block\Product\Context $context,
\Magento\Framework\Data\Helper\PostHelper $postDataHelper,
\Magento\Catalog\Model\Layer\Resolver $layerResolver,
CategoryRepositoryInterface $categoryRepository,
\Magento\Framework\Url\Helper\Data $urlHelper,
CollectionFactory $productCollectionFactory,
array $data = []
) {
$this->_productCollectionFactory = $productCollectionFactory;
parent::__construct(
$context,
$postDataHelper,
$layerResolver,
$categoryRepository,
$urlHelper,
$data
);
}
/**
* @return Collection
*/
protected function _getProductCollection()
{
if ($this->_productCollection === null) {
/** @var Collection $collection */
$collection = $this->_productCollectionFactory->create();
$this->_catalogLayer->prepareProductCollection($collection);
$collection->addAttributeToFilter('promotion', 1)->addStoreFilter();
$this->_productCollection = $collection;
}
return $this->_productCollection;
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Block\Product\ProductList;
use Magento\Catalog\Api\CategoryRepositoryInterface;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
use Magento\Catalog\Model\ResourceModel\Product\CollectionFactory;
class Promotion extends \Magento\Catalog\Block\Product\ListProduct
{
/**
* Product collection factory
*
* @var CollectionFactory
*/
protected $_productCollectionFactory;
/**
* @var CategoryRepositoryInterface
*/
protected $categoryRepository;
/**
* @param \Magento\Catalog\Block\Product\Context $context
* @param \Magento\Framework\Data\Helper\PostHelper $postDataHelper
* @param \Magento\Catalog\Model\Layer\Resolver $layerResolver
* @param CategoryRepositoryInterface $categoryRepository
* @param \Magento\Framework\Url\Helper\Data $urlHelper
* @param CollectionFactory $productCollectionFactory
* @param array $data
*/
public function __construct(
\Magento\Catalog\Block\Product\Context $context,
\Magento\Framework\Data\Helper\PostHelper $postDataHelper,
\Magento\Catalog\Model\Layer\Resolver $layerResolver,
CategoryRepositoryInterface $categoryRepository,
\Magento\Framework\Url\Helper\Data $urlHelper,
CollectionFactory $productCollectionFactory,
array $data = []
) {
$this->_productCollectionFactory = $productCollectionFactory;
parent::__construct(
$context,
$postDataHelper,
$layerResolver,
$categoryRepository,
$urlHelper,
$data
);
}
/**
* @return Collection
*/
protected function _getProductCollection()
{
if ($this->_productCollection === null) {
/** @var Collection $collection */
$collection = $this->_productCollectionFactory->create();
$this->_catalogLayer->prepareProductCollection($collection);
$collection->addAttributeToFilter('promotion', 1)->addStoreFilter();
$this->_productCollection = $collection;
}
return $this->_productCollection;
}
}
Function Calls
None |
Stats
MD5 | 32b06dcefa547a7b50d3fa9d8c8d5f7f |
Eval Count | 0 |
Decode Time | 111 ms |