![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/amasty/feed/Controller/Adminhtml/Feed/ |
<?php /** * @author Amasty Team * @copyright Copyright (c) Amasty (https://www.amasty.com) * @package Product Feed for Magento 2 */ namespace Amasty\Feed\Controller\Adminhtml\Feed; use Magento\Rule\Model\Condition\AbstractCondition; class NewConditionHtml extends \Amasty\Feed\Controller\Adminhtml\AbstractFeed { /** * @var \Amasty\Feed\Model\Rule\RuleFactory */ private $ruleFactory; public function __construct( \Magento\Backend\App\Action\Context $context, \Amasty\Feed\Model\Rule\RuleFactory $ruleFactory ) { parent::__construct($context); $this->ruleFactory = $ruleFactory; } /** * @return void */ public function execute() { $id = $this->getRequest()->getParam('id'); $typeArr = explode('|', str_replace('-', '/', $this->getRequest()->getParam('type'))); $type = $typeArr[0]; $model = $this->_objectManager->create( $type )->setId( $id )->setType( $type )->setRule( $this->ruleFactory->create() )->setPrefix( 'conditions' ); if (!empty($typeArr[1])) { $model->setAttribute($typeArr[1]); } if ($model instanceof AbstractCondition) { $model->setJsFormObject($this->getRequest()->getParam('form')); $html = $model->asHtmlRecursive(); } else { $html = ''; } $this->getResponse()->setBody($html); } }