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/Ecombricks/InventoryCustomerSourceSelection/Plugin/Model/Store/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //home/corals/old/app/code/Ecombricks/InventoryCustomerSourceSelection/Plugin/Model/Store/Store.php
<?php
/**
 * Copyright © eComBricks. All rights reserved.
 * See LICENSE.txt for license details.
 */
declare(strict_types=1);

namespace Ecombricks\InventoryCustomerSourceSelection\Plugin\Model\Store;

/**
 * Store plugin
 */
class Store
{
    /**
     * Configuration cache
     * 
     * @var \Magento\Framework\App\Cache\Type\Config
     */
    private $configCache;

    /**
     * Resource
     * 
     * @var \Magento\Store\Model\ResourceModel\Store
     */
    private $resource;

    /**
     * Constructor
     * 
     * @param \Magento\Framework\App\Cache\Type\Config $configCache
     * @param \Magento\Store\Model\ResourceModel\Store $resource
     * @return void
     */
    public function __construct(
        \Magento\Framework\App\Cache\Type\Config $configCache,
        \Magento\Store\Model\ResourceModel\Store $resource
    )
    {
        $this->configCache = $configCache;
        $this->resource = $resource;
    }

    /**
     * After after delete
     * 
     * @param \Magento\Store\Model\Store $subject
     * @param \Magento\Store\Model\Store $result
     * @return \Magento\Store\Model\Store
     */
    public function afterAfterDelete(
        \Magento\Store\Model\Store $subject,
        $result
    )
    {
        $this->resource->getConnection()->delete(
            $this->resource->getTable('ecombricks_inventory__source_core_config_data'),
            [
                'scope = ?' => \Magento\Store\Model\ScopeInterface::SCOPE_STORES,
                'scope_id = ?' => $subject->getStoreId(),
            ]
        );
        $this->configCache->clean();
        return $result;
    }
}

Spamworldpro Mini