PHP code example of magetu / module-data-cleanup

1. Go to this page and download the library: Download magetu/module-data-cleanup library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

magetu / module-data-cleanup example snippets


   namespace Acme\Cleanup\Setup\Patch\Data;

   use Magetu\ModuleDataCleanUp\Setup\Patch\AbstractModuleDataCleanUp;

   class RemoveFooBar extends AbstractModuleDataCleanUp
   {
       protected string $moduleName = 'Foo_Bar';

       /** @var string[] */
       protected array $attributeCodes = ['foo_bar_flag'];

       /** @var string[] */
       protected array $configSectionGroups = ['foobar/', 'payment/foo_bar/active'];
   }
   

   namespace Acme\Cleanup\Setup\Patch\Schema;

   use Magetu\ModuleDataCleanUp\Setup\Patch\AbstractModuleSchemaCleanUp;

   class RemoveFooBar extends AbstractModuleSchemaCleanUp
   {
       /** @var string[] */
       protected array $tableNames = ['foo_bar_item', 'foo_bar'];

       /** @var array<string, string[]> */
       protected array $coreTableColumnMappings = ['sales_order' => ['foo_bar_token']];
   }