/** * Get messages * * @return array */ public function getMessages() { $list = parent::getMessages(); $data = $this->getOptions()->columnsMetaData; if ($data) { foreach (\XLite\Logic\Import\Importer::getProcessorList() as $processor) { if (isset($data[$processor])) { $message = $processor::getResultMessage($data[$processor]); if ($message) { $list[] = $message; } } } } return $list; }
/** * Get processor list * * @return array */ public static function getProcessorList() { return array_merge(parent::getProcessorList(), array('XLite\\Module\\XC\\Reviews\\Logic\\Import\\Processor\\Reviews')); }
/** * Return error texts * * @return array */ protected function getErrorTexts() { $result = array(); foreach (\XLite\Logic\Import\Importer::getProcessorList() as $processor) { $result = array_merge($result, $processor::getErrorTexts()); } return $result; }
/** * Get processor list * * @return array */ public static function getProcessorList() { return array_merge(parent::getProcessorList(), array('XLite\\Module\\XC\\PitneyBowes\\Logic\\Import\\Processor\\ProductRestrictions')); }
/** * Checks whether the widget is visible, or not * * @return boolean */ protected function isVisible() { $result = parent::isVisible(); if ($result) { $state = \XLite\Core\Database::getRepo('XLite\\Model\\TmpVar')->getEventState($this->getEventName()); $result = false; if ($state && \XLite\Core\EventTask::STATE_FINISHED == $state['state']) { $data = $state['options']['columnsMetaData']; if ($data) { foreach (\XLite\Logic\Import\Importer::getProcessorList() as $processor) { $addCount = isset($data[$processor]['addCount']) ? $data[$processor]['addCount'] : 0; $updateCount = isset($data[$processor]['updateCount']) ? $data[$processor]['updateCount'] : 0; if (isset($data[$processor]) && 0 < $addCount + $updateCount) { $result = true; break; } } } } elseif ($state) { $result = true; } } return $result; }