Ejemplo n.º 1
0
 public function __construct(\Ess\M2ePro\Model\Factory $modelFactory, \Ess\M2ePro\Helper\Factory $helperFactory, \Magento\Rule\Model\Condition\Context $context, array $data = [])
 {
     $this->_logger = $context->getLogger();
     parent::__construct($modelFactory, $helperFactory, $context, $data);
     $this->setType('Magento\\Rule\\Model\\Condition\\Combine')->setAggregator('all')->setValue(true)->setConditions(array())->setActions(array());
     $this->loadAggregatorOptions();
     if ($options = $this->getAggregatorOptions()) {
         foreach ($options as $aggregator => $dummy) {
             $this->setAggregator($aggregator);
             break;
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * @param Context $context
  * @param array $data
  */
 public function __construct(Context $context, array $data = [])
 {
     $this->_assetRepo = $context->getAssetRepository();
     $this->_localeDate = $context->getLocaleDate();
     $this->_layout = $context->getLayout();
     parent::__construct($data);
     $this->loadAttributeOptions()->loadOperatorOptions()->loadValueOptions();
     $options = $this->getAttributeOptions();
     if ($options) {
         foreach (array_keys($options) as $attr) {
             $this->setAttribute($attr);
             break;
         }
     }
     $options = $this->getOperatorOptions();
     if ($options) {
         foreach (array_keys($options) as $operator) {
             $this->setOperator($operator);
             break;
         }
     }
 }
Ejemplo n.º 3
0
 public function __construct(\Ess\M2ePro\Model\Factory $modelFactory, \Ess\M2ePro\Helper\Factory $helperFactory, \Magento\Rule\Model\Condition\Context $context, array $data = [])
 {
     $this->modelFactory = $modelFactory;
     $this->helperFactory = $helperFactory;
     $this->_assetRepo = $context->getAssetRepository();
     $this->_localeDate = $context->getLocaleDate();
     $this->_layout = $context->getLayout();
     parent::__construct($data);
     $this->loadAttributeOptions()->loadOperatorOptions()->loadValueOptions();
     if ($options = $this->getAttributeOptions()) {
         foreach ($options as $attr => $dummy) {
             $this->setAttribute($attr);
             break;
         }
     }
     if ($options = $this->getOperatorOptions()) {
         foreach ($options as $operator => $dummy) {
             $this->setOperator($operator);
             break;
         }
     }
 }