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.
*/
/**
* Catalog Product Website Model
*
* @method int getWebsiteId()
* @method \Magento\Catalog\Model\Product\Website setWebsiteId(int $value)
*
* @author Magento Core Team <[email protected]>
*/
namespace Magento\Catalog\Model\Product;
class Website extends \Magento\Framework\Model\AbstractModel
{
/**
* Initialize resource model
*
* @return void
*/
protected function _construct()
{
$this->_init(\Magento\Catalog\Model\ResourceModel\Product\Website::class);
}
/**
* Removes products from websites
*
* @param array $websiteIds
* @param array $productIds
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function removeProducts($websiteIds, $productIds)
{
try {
$this->_getResource()->removeProducts($websiteIds, $productIds);
} catch (\Exception $e) {
throw new \Magento\Framework\Exception\LocalizedException(
__('Something went wrong while removing products from the websites.')
);
}
return $this;
}
/**
* Add products to websites
*
* @param array $websiteIds
* @param array $productIds
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function addProducts($websiteIds, $productIds)
{
try {
$this->_getResource()->addProducts($websiteIds, $productIds);
} catch (\Exception $e) {
throw new \Magento\Framework\Exception\LocalizedException(
__('Something went wrong while adding products to websites.')
);
}
return $this;
}
/**
* Retrieve product websites
* Return array with key as product ID and value array of websites
*
* @param int|array $productIds
* @return array
*/
public function getWebsites($productIds)
{
return $this->_getResource()->getWebsites($productIds);
}
}
?>
Did this file decode correctly?
Original Code
<?php
/**
* Copyright Magento, Inc. All rights reserved.
* See COPYING.txt for license details.
*/
/**
* Catalog Product Website Model
*
* @method int getWebsiteId()
* @method \Magento\Catalog\Model\Product\Website setWebsiteId(int $value)
*
* @author Magento Core Team <[email protected]>
*/
namespace Magento\Catalog\Model\Product;
class Website extends \Magento\Framework\Model\AbstractModel
{
/**
* Initialize resource model
*
* @return void
*/
protected function _construct()
{
$this->_init(\Magento\Catalog\Model\ResourceModel\Product\Website::class);
}
/**
* Removes products from websites
*
* @param array $websiteIds
* @param array $productIds
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function removeProducts($websiteIds, $productIds)
{
try {
$this->_getResource()->removeProducts($websiteIds, $productIds);
} catch (\Exception $e) {
throw new \Magento\Framework\Exception\LocalizedException(
__('Something went wrong while removing products from the websites.')
);
}
return $this;
}
/**
* Add products to websites
*
* @param array $websiteIds
* @param array $productIds
* @return $this
* @throws \Magento\Framework\Exception\LocalizedException
*/
public function addProducts($websiteIds, $productIds)
{
try {
$this->_getResource()->addProducts($websiteIds, $productIds);
} catch (\Exception $e) {
throw new \Magento\Framework\Exception\LocalizedException(
__('Something went wrong while adding products to websites.')
);
}
return $this;
}
/**
* Retrieve product websites
* Return array with key as product ID and value array of websites
*
* @param int|array $productIds
* @return array
*/
public function getWebsites($productIds)
{
return $this->_getResource()->getWebsites($productIds);
}
}
Function Calls
None |
Stats
MD5 | c17f704ef3c6a4863e9a7643a4ddb456 |
Eval Count | 0 |
Decode Time | 124 ms |