Spamworldpro Mini Shell
Spamworldpro


Server : Apache
System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64
User : corals ( 1002)
PHP Version : 7.4.33
Disable Function : exec,passthru,shell_exec,system
Directory :  /home/corals/old/app/code/Cnc/SeoMarkup/Setup/Patch/Data/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/corals/old/app/code/Cnc/SeoMarkup/Setup/Patch/Data/ConfigureBrand.php
<?php
/**
 * Copyright (c) 2021 Kaliop Digital Commerce (https://digitalcommerce.kaliop.com) All Rights Reserved.
 * https://opensource.org/licenses/OSL-3.0  Open Software License (OSL 3.0)
 * Cnc
 * Krzysztof Majkowski <[email protected]> <[email protected]>
 */
namespace Cnc\SeoMarkup\Setup\Patch\Data;

use Magento\Framework\App\Config\ScopeConfigInterface;
use Magento\Framework\App\Config\Storage\WriterInterface;
use Magento\Framework\Setup\ModuleDataSetupInterface;
use Magento\Framework\Setup\Patch\DataPatchInterface;

class ConfigureBrand implements DataPatchInterface
{
    private $config = [
        'mageworx_seo/markup/product/brand_enabled' => 1,
        'mageworx_seo/markup/product/gtin_enabled' => 1,
        'mageworx_seo/markup/product/brand_code' => 'cnc_manufacturer',
        'mageworx_seo/markup/product/gtin_code' => 'sku',
    ];

    /**
     * @var ModuleDataSetupInterface
     */
    private $moduleDataSetup;

    /**
     * @var WriterInterface
     */
    private $writer;

    /**
     * ConfigureBrand constructor.
     * @param ModuleDataSetupInterface $moduleDataSetup
     * @param WriterInterface $writer
     */
    public function __construct(
        ModuleDataSetupInterface $moduleDataSetup,
        WriterInterface $writer
    ) {
        $this->moduleDataSetup = $moduleDataSetup;
        $this->writer = $writer;
    }

    public static function getDependencies(): array
    {
        return [];
    }

    public function getAliases(): array
    {
        return [];
    }

    /**
     * Disable description display from search autocomplete
     * @return ConfigureBrand|void
     */
    public function apply()
    {
        $this->moduleDataSetup->startSetup();

        foreach ($this->config as $key => $value) {
            $this->writer->save(
                $key,
                $value,
                ScopeConfigInterface::SCOPE_TYPE_DEFAULT,
                0
            );
        }

        $this->moduleDataSetup->endSetup();
    }
}

Spamworldpro Mini