|
Apache/2.4.41 (Ubuntu) Linux vmi616275.contaboserver.net 5.4.0-84-generic #94-Ubuntu SMP Thu Aug 26 20:27:37 UTC 2021 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) server ip : 62.171.164.128 | your ip : 127.0.0.1 safemode OFF > / home / a / home / dev2.destoffenstraat.com / app / Firebear / ImportExport / Model / Api / Import / |
Filename | /home/a/home/dev2.destoffenstraat.com/app/Firebear/ImportExport/Model/Api/Import/Process.php |
Size | 2.17 kb |
Permission | rw-rw-r-- |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 07-Nov-2022 06:44 |
Last accessed | 23-Aug-2025 13:16 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
/**
* @copyright: Copyright © 2020 Firebear Studio. All rights reserved.
* @author: Firebear Studio <fbeardev@gmail.com>
*/
namespace Firebear\ImportExport\Model\Api\Import;
use Firebear\ImportExport\Api\Import\ProcessInterface;
use Firebear\ImportExport\Api\Import\ProcessResponseInterface;
use Firebear\ImportExport\Model\Job\Processor;
use Firebear\ImportExport\Model\Job\ProcessorFactory;
use Firebear\ImportExport\Helper\Data as Helper;
/**
* Job process command (Service Provider Interface - SPI)
*
* @api
*/
class Process implements ProcessInterface
{
/**
* @var ProcessorFactory
*/
private $processorFactory;
/**
* @var Processor
*/
private $processor;
/**
* @var Helper
*/
private $helper;
/**
* @var ProcessResponseInterface
*/
private $response;
/**
* Initialize command
*
* @param ProcessorFactory $processorFactory
* @param ProcessResponseInterface $response
* @param Helper $helper
*/
public function __construct(
ProcessorFactory $processorFactory,
ProcessResponseInterface $response,
Helper $helper
) {
$this->processorFactory = $processorFactory;
$this->response = $response;
$this->helper = $helper;
}
/**
* Process import
*
* @param int $jobId
* @param string $file
* @param int $offset
* @param string $error
* @return ProcessResponseInterface
*/
public function execute($jobId, $file, $offset, $error)
{
list($count, $result) = $this->getProcessor()->processImport($file, $jobId, $offset, $error);
$this->response->setCount($count);
$this->response->setResult($result);
return $this->response;
}
/**
* Retrieve import processor
*
* @return Processor
*/
private function getProcessor()
{
if (null === $this->processor) {
$this->processor = $this->processorFactory->create();
$this->processor->setDebugMode($this->helper->getDebugMode());
$this->processor->setLogger($this->helper->getLogger());
}
return $this->processor;
}
}
/**
* @copyright: Copyright © 2020 Firebear Studio. All rights reserved.
* @author: Firebear Studio <fbeardev@gmail.com>
*/
namespace Firebear\ImportExport\Model\Api\Import;
use Firebear\ImportExport\Api\Import\ProcessInterface;
use Firebear\ImportExport\Api\Import\ProcessResponseInterface;
use Firebear\ImportExport\Model\Job\Processor;
use Firebear\ImportExport\Model\Job\ProcessorFactory;
use Firebear\ImportExport\Helper\Data as Helper;
/**
* Job process command (Service Provider Interface - SPI)
*
* @api
*/
class Process implements ProcessInterface
{
/**
* @var ProcessorFactory
*/
private $processorFactory;
/**
* @var Processor
*/
private $processor;
/**
* @var Helper
*/
private $helper;
/**
* @var ProcessResponseInterface
*/
private $response;
/**
* Initialize command
*
* @param ProcessorFactory $processorFactory
* @param ProcessResponseInterface $response
* @param Helper $helper
*/
public function __construct(
ProcessorFactory $processorFactory,
ProcessResponseInterface $response,
Helper $helper
) {
$this->processorFactory = $processorFactory;
$this->response = $response;
$this->helper = $helper;
}
/**
* Process import
*
* @param int $jobId
* @param string $file
* @param int $offset
* @param string $error
* @return ProcessResponseInterface
*/
public function execute($jobId, $file, $offset, $error)
{
list($count, $result) = $this->getProcessor()->processImport($file, $jobId, $offset, $error);
$this->response->setCount($count);
$this->response->setResult($result);
return $this->response;
}
/**
* Retrieve import processor
*
* @return Processor
*/
private function getProcessor()
{
if (null === $this->processor) {
$this->processor = $this->processorFactory->create();
$this->processor->setDebugMode($this->helper->getDebugMode());
$this->processor->setLogger($this->helper->getLogger());
}
return $this->processor;
}
}