Exemplo n.º 1
0
 /**
  * Export action
  *
  * @return void
  */
 protected function doActionExport()
 {
     foreach (\XLite\Core\Request::getInstance()->options as $key => $value) {
         if (!\XLite\Core\Config::getInstance()->Export || \XLite\Core\Config::getInstance()->Export->{$key} != $value) {
             \XLite\Core\Database::getRepo('XLite\\Model\\Config')->createOption(array('category' => 'Export', 'name' => $key, 'value' => $value));
         }
     }
     if (in_array('XLite\\Logic\\Export\\Step\\AttributeValues\\AttributeValueCheckbox', \XLite\Core\Request::getInstance()->section)) {
         $addSections = array('XLite\\Logic\\Export\\Step\\AttributeValues\\AttributeValueSelect', 'XLite\\Logic\\Export\\Step\\AttributeValues\\AttributeValueText');
         \XLite\Core\Request::getInstance()->section = array_merge(\XLite\Core\Request::getInstance()->section, $addSections);
     }
     \XLite\Logic\Export\Generator::run($this->assembleExportOptions());
 }
Exemplo n.º 2
0
 /**
  * Send catalog to PB SFTP
  *
  * @return void
  */
 public function doActionExport()
 {
     $isDifferential = !empty(\XLite\Core\Request::getInstance()->type) && \XLite\Core\Request::getInstance()->type === 'diff';
     \XLite\Logic\Export\Generator::run(\XLite\Logic\Export\Generator::getPBExportOptions(array('differential' => $isDifferential)));
 }
Exemplo n.º 3
0
 /**
  * Run catalog submission
  * 
  * @param boolean $diff Perform differential extraction (default: false, full extraction)
  * 
  * @return void
  */
 protected function runSubmit($diff = false)
 {
     \XLite\Logger::logCustom("PitneyBowes", 'Submitting catalog (diff: ' . var_export($diff, true) . ')', false);
     \XLite\Logic\Export\Generator::run(\XLite\Logic\Export\Generator::getPBExportOptions(array('differential' => $diff)));
     $running = \XLite\Logic\Export\Generator::runHeadless();
     //submit to pb
     if (!$running) {
         $config = $this->getConfiguration();
         $processor = new PitneyBowes\Logic\FileExchange\Processor($config);
         $generator = $this->getGenerator();
         if ($generator) {
             $processor->submitCatalog($generator->getCatalogFiles(), $generator->getOptions()->differential);
         }
     }
 }