Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
websites_with_stores_rollback.php
Go to the documentation of this file.
1 <?php
7 declare(strict_types=1);
8 
12 
14 $registry = Bootstrap::getObjectManager()->get(Registry::class);
15 
16 $registry->unregister('isSecureArea');
17 $registry->register('isSecureArea', true);
18 
19 $websiteCodes = ['eu_website', 'us_website', 'global_website'];
20 
21 foreach ($websiteCodes as $websiteCode) {
23  $website = Bootstrap::getObjectManager()->create(Website::class);
24  $website->load($websiteCode, 'code');
25  if ($website->getId()) {
26  $website->delete();
27  }
28 }
29 
30 $registry->unregister('isSecureArea');
31 $registry->register('isSecureArea', false);
if(!isset($_GET['website_code'])) $websiteCode
Definition: website.php:11