b374k
m1n1 1.01
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 /
Filename/home/a/home/dev2.destoffenstraat.com/app/Firebear/ImportExport/Model/JobRepository.php
Size3.39 kb
Permissionrwxr-xr-x
Ownerroot : root
Create time21-Aug-2025 12:26
Last modified07-Nov-2022 06:44
Last accessed22-Aug-2025 22:34
Actionsedit | rename | delete | download (gzip)
Viewtext | code | image
<?php
/**
* @copyright: Copyright © 2017 Firebear Studio GmbH. All rights reserved.
* @author : Firebear Studio <fbeardev@gmail.com>
*/
namespace Firebear\ImportExport\Model;

use Firebear\ImportExport\Api\Data\ImportInterface;
use Firebear\ImportExport\Api\JobRepositoryInterface;
use Firebear\ImportExport\Api\Import\GetByIdInterface;
use Firebear\ImportExport\Api\Import\GetListInterface;
use Firebear\ImportExport\Api\Import\SaveInterface;
use Firebear\ImportExport\Api\Import\DeleteInterface;
use Firebear\ImportExport\Api\Import\DeleteByIdInterface;
use Firebear\ImportExport\Api\Import\SearchResultsInterface;
use Magento\Framework\Api\SearchCriteriaInterface;
use Magento\Framework\Exception\CouldNotDeleteException;
use Magento\Framework\Exception\CouldNotSaveException;
use Magento\Framework\Exception\NoSuchEntityException;

/**
* Class JobRepository
*
* @package Firebear\ImportExport\Model
*/
class JobRepository implements JobRepositoryInterface
{
/**
* @var GetByIdInterface
*/
private $commandGetById;

/**
* @var GetListInterface
*/
private $commandGetList;

/**
* @var SaveInterface
*/
private $commandSave;

/**
* @var DeleteInterface
*/
private $commandDelete;

/**
* @var DeleteByIdInterface
*/
private $commandDeleteById;

/**
* Initialize repository
*
* @param GetByIdInterface $commandGetById
* @param GetListInterface $commandGetList
* @param SaveInterface $commandSave
* @param DeleteInterface $commandDelete
* @param DeleteByIdInterface $commandDeleteById
*/
public function __construct(
GetByIdInterface $commandGetById,
GetListInterface $commandGetList,
SaveInterface $commandSave,
DeleteInterface $commandDelete,
DeleteByIdInterface $commandDeleteById
) {
$this->commandGetById = $commandGetById;
$this->commandGetList = $commandGetList;
$this->commandSave = $commandSave;
$this->commandDelete = $commandDelete;
$this->commandDeleteById = $commandDeleteById;
}

/**
* Save job
*
* @param ImportInterface $job
* @return ImportInterface
* @throws CouldNotSaveException
*/
public function save(ImportInterface $job)
{
return $this->commandSave->execute($job);
}

/**
* Get job by id
*
* @param int $jobId
* @return ImportInterface
* @throws NoSuchEntityException
*/
public function getById($jobId)
{
return $this->commandGetById->execute($jobId);
}

/**
* Delete job
*
* @param ImportInterface $job
* @return bool true on success
* @throws CouldNotDeleteException
*/
public function delete(ImportInterface $job)
{
return $this->commandDelete->execute($job);
}

/**
* Delete job by id
*
* @param int $jobId
* @return bool true on success
* @throws NoSuchEntityException
* @throws CouldNotDeleteException
*/
public function deleteById($jobId)
{
return $this->commandDeleteById->execute($jobId);
}

/**
* Get job list
*
* @param SearchCriteriaInterface|null $searchCriteria
* @return SearchResultsInterface
*/
public function getList(SearchCriteriaInterface $searchCriteria = null)
{
return $this->commandGetList->execute($searchCriteria);
}
}