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.
*/
declare(strict_types=1);
namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface;
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\GraphQl\Model\Query\ContextInterface;
/**
* Add attributes required for every GraphQL product resolution process.
*
* {@inheritdoc}
*/
class RequiredColumnsProcessor implements CollectionProcessorInterface
{
/**
* Process collection to add additional joins, attributes, and clauses to a product collection.
*
* @param Collection $collection
* @param SearchCriteriaInterface $searchCriteria
* @param array $attributeNames
* @param ContextInterface|null $context
* @return Collection
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function process(
Collection $collection,
SearchCriteriaInterface $searchCriteria,
array $attributeNames,
ContextInterface $context = null
): Collection {
$collection->addAttributeToSelect('special_price');
$collection->addAttributeToSelect('special_from_date');
$collection->addAttributeToSelect('special_to_date');
$collection->addAttributeToSelect('tax_class_id');
return $collection;
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
declare(strict_types=1);
namespace Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessor;
use Magento\Catalog\Model\ResourceModel\Product\Collection;
use Magento\CatalogGraphQl\Model\Resolver\Products\DataProvider\Product\CollectionProcessorInterface;
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\GraphQl\Model\Query\ContextInterface;
/**
* Add attributes required for every GraphQL product resolution process.
*
* {@inheritdoc}
*/
class RequiredColumnsProcessor implements CollectionProcessorInterface
{
/**
* Process collection to add additional joins, attributes, and clauses to a product collection.
*
* @param Collection $collection
* @param SearchCriteriaInterface $searchCriteria
* @param array $attributeNames
* @param ContextInterface|null $context
* @return Collection
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
*/
public function process(
Collection $collection,
SearchCriteriaInterface $searchCriteria,
array $attributeNames,
ContextInterface $context = null
): Collection {
$collection->addAttributeToSelect('special_price');
$collection->addAttributeToSelect('special_from_date');
$collection->addAttributeToSelect('special_to_date');
$collection->addAttributeToSelect('tax_class_id');
return $collection;
}
}
Function Calls
| None |
Stats
| MD5 | 6988342d676bf61db34820accf56773f |
| Eval Count | 0 |
| Decode Time | 92 ms |