44 lines
1.1 KiB
PHP
44 lines
1.1 KiB
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace Esun\Wiki\Setup\Patch\Data;
|
|
|
|
use Magento\Framework\Setup\ModuleDataSetupInterface;
|
|
use Magento\Framework\Setup\Patch\DataPatchInterface;
|
|
|
|
class EnableDownloadCenterForPrintingParameters implements DataPatchInterface
|
|
{
|
|
private const TARGET_SLUG = 'printing-parameters-download';
|
|
|
|
public function __construct(private readonly ModuleDataSetupInterface $moduleDataSetup)
|
|
{
|
|
}
|
|
|
|
public function apply(): self
|
|
{
|
|
$connection = $this->moduleDataSetup->getConnection();
|
|
$table = $this->moduleDataSetup->getTable('esun_wiki_category');
|
|
$connection->startSetup();
|
|
|
|
$connection->update($table, ['show_download_center' => 0]);
|
|
$connection->update(
|
|
$table,
|
|
['show_download_center' => 1],
|
|
['slug = ?' => self::TARGET_SLUG]
|
|
);
|
|
$connection->endSetup();
|
|
|
|
return $this;
|
|
}
|
|
|
|
public static function getDependencies(): array
|
|
{
|
|
return [AssignExistingCategoriesToAllStores::class];
|
|
}
|
|
|
|
public function getAliases(): array
|
|
{
|
|
return [];
|
|
}
|
|
}
|