|
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 / Migration / PreJob / |
Filename | /home/a/home/dev2.destoffenstraat.com/app/Firebear/ImportExport/Model/Migration/PreJob/Delete.php |
Size | 1.45 kb |
Permission | rwxr-xr-x |
Owner | root : root |
Create time | 21-Aug-2025 12:26 |
Last modified | 07-Nov-2022 06:44 |
Last accessed | 23-Aug-2025 18:14 |
Actions | edit | rename | delete | download (gzip) |
View | text | code | image |
<?php
/**
* @copyright: Copyright © 2019 Firebear Studio. All rights reserved.
* @author : Firebear Studio <fbeardev@gmail.com>
*/
namespace Firebear\ImportExport\Model\Migration\PreJob;
use Firebear\ImportExport\Model\Migration\Config;
use Firebear\ImportExport\Model\Migration\DbConnection;
use Firebear\ImportExport\Model\Migration\PreJobInterface;
/**
* @inheritdoc
*/
class Delete implements PreJobInterface
{
/**
* @var DbConnection
*/
protected $dbConnection;
/**
* @var string
*/
protected $table;
/**
* @var string
*/
protected $cond;
/**
* @var Config
*/
protected $config;
/**
* @param DbConnection $dbConnection
* @param Config $config
* @param string $table
* @param string $cond
*/
public function __construct(
DbConnection $dbConnection,
Config $config,
string $table,
string $cond
) {
$this->dbConnection = $dbConnection;
$this->config = $config;
$this->table = $table;
$this->cond = $cond;
}
/**
* @inheritdoc
*/
public function job()
{
$this->dbConnection->getDestinationChannel()->query('SET FOREIGN_KEY_CHECKS = 0;');
$this->dbConnection->getDestinationChannel()->delete($this->config->getM2Prefix() . $this->table, $this->cond);
$this->dbConnection->getDestinationChannel()->query('SET FOREIGN_KEY_CHECKS = 1;');
}
}
/**
* @copyright: Copyright © 2019 Firebear Studio. All rights reserved.
* @author : Firebear Studio <fbeardev@gmail.com>
*/
namespace Firebear\ImportExport\Model\Migration\PreJob;
use Firebear\ImportExport\Model\Migration\Config;
use Firebear\ImportExport\Model\Migration\DbConnection;
use Firebear\ImportExport\Model\Migration\PreJobInterface;
/**
* @inheritdoc
*/
class Delete implements PreJobInterface
{
/**
* @var DbConnection
*/
protected $dbConnection;
/**
* @var string
*/
protected $table;
/**
* @var string
*/
protected $cond;
/**
* @var Config
*/
protected $config;
/**
* @param DbConnection $dbConnection
* @param Config $config
* @param string $table
* @param string $cond
*/
public function __construct(
DbConnection $dbConnection,
Config $config,
string $table,
string $cond
) {
$this->dbConnection = $dbConnection;
$this->config = $config;
$this->table = $table;
$this->cond = $cond;
}
/**
* @inheritdoc
*/
public function job()
{
$this->dbConnection->getDestinationChannel()->query('SET FOREIGN_KEY_CHECKS = 0;');
$this->dbConnection->getDestinationChannel()->delete($this->config->getM2Prefix() . $this->table, $this->cond);
$this->dbConnection->getDestinationChannel()->query('SET FOREIGN_KEY_CHECKS = 1;');
}
}