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\Ui\DataProvider\Product\Attributes;
use Magento\Catalog\Model\AttributeHandler;
use Magento\Framework\App\RequestInterface;
use Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory;
/**
* DataProvider for product attributes listing
*/
class Listing extends \Magento\Ui\DataProvider\AbstractDataProvider
{
/**
* @var RequestInterface
*/
protected $request;
/**
* @param string $name
* @param string $primaryFieldName
* @param string $requestFieldName
* @param CollectionFactory $collectionFactory
* @param RequestInterface $request
* @param array $meta
* @param array $data
*/
public function __construct(
$name,
$primaryFieldName,
$requestFieldName,
CollectionFactory $collectionFactory,
RequestInterface $request,
array $meta = [],
array $data = []
) {
parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
$this->request = $request;
$this->collection = $collectionFactory->create();
}
/**
* {@inheritdoc}
*/
public function getData()
{
$this->collection->setExcludeSetFilter((int)$this->request->getParam('template_id', 0));
$this->collection->getSelect()->setPart('order', []);
$items = [];
foreach ($this->getCollection()->getItems() as $attribute) {
$items[] = $attribute->toArray();
}
return [
'totalRecords' => $this->collection->getSize(),
'items' => $items
];
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
namespace Magento\Catalog\Ui\DataProvider\Product\Attributes;
use Magento\Catalog\Model\AttributeHandler;
use Magento\Framework\App\RequestInterface;
use Magento\Catalog\Model\ResourceModel\Product\Attribute\CollectionFactory;
/**
* DataProvider for product attributes listing
*/
class Listing extends \Magento\Ui\DataProvider\AbstractDataProvider
{
/**
* @var RequestInterface
*/
protected $request;
/**
* @param string $name
* @param string $primaryFieldName
* @param string $requestFieldName
* @param CollectionFactory $collectionFactory
* @param RequestInterface $request
* @param array $meta
* @param array $data
*/
public function __construct(
$name,
$primaryFieldName,
$requestFieldName,
CollectionFactory $collectionFactory,
RequestInterface $request,
array $meta = [],
array $data = []
) {
parent::__construct($name, $primaryFieldName, $requestFieldName, $meta, $data);
$this->request = $request;
$this->collection = $collectionFactory->create();
}
/**
* {@inheritdoc}
*/
public function getData()
{
$this->collection->setExcludeSetFilter((int)$this->request->getParam('template_id', 0));
$this->collection->getSelect()->setPart('order', []);
$items = [];
foreach ($this->getCollection()->getItems() as $attribute) {
$items[] = $attribute->toArray();
}
return [
'totalRecords' => $this->collection->getSize(),
'items' => $items
];
}
}
Function Calls
None |
Stats
MD5 | 587ca28d89860bc4bbb8862ac49554b9 |
Eval Count | 0 |
Decode Time | 80 ms |