Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Variables
website_attribute_sync_rollback.php File Reference

Go to the source code of this file.

Variables

 $productId = 333
 
 $objectManager = Bootstrap::getObjectManager()
 
 $storeRepository = $objectManager->get(StoreRepositoryInterface::class)
 
 $resourceConnection = $objectManager->get(ResourceConnection::class)
 
 $connection = $resourceConnection->getConnection()
 
 $registry = $objectManager->get(Registry::class)
 
 $productRepository = $objectManager->get(ProductRepositoryInterface::class)
 
 $isSecuredAreaSystemState = $registry->registry('isSecuredArea')
 
 $store = $storeRepository->get('customstoreview1')
 
 $storeGroupId = $store->getStoreGroupId()
 
 $websiteId = $store->getWebsiteId()
 
 try
 
if($product->getId()) catch(\Magento\Framework\Exception\NoSuchEntityException $e) $storeCodes
 
 $website = Bootstrap::getObjectManager()->create(\Magento\Store\Model\Website::class)
 

Variable Documentation

◆ $connection

$connection = $resourceConnection->getConnection()

Definition at line 29 of file website_attribute_sync_rollback.php.

◆ $isSecuredAreaSystemState

$isSecuredAreaSystemState = $registry->registry('isSecuredArea')

Marks area as secure so Product repository would allow product removal

Definition at line 37 of file website_attribute_sync_rollback.php.

◆ $objectManager

$objectManager = Bootstrap::getObjectManager()

Definition at line 23 of file website_attribute_sync_rollback.php.

◆ $productId

$productId = 333

Roll back fixtures

  • Remove Product
  • Remove Website/StoreGroup/[Store1, Store2]
  • ReIndex Full text indexers

Definition at line 22 of file website_attribute_sync_rollback.php.

◆ $productRepository

$productRepository = $objectManager->get(ProductRepositoryInterface::class)

Definition at line 31 of file website_attribute_sync_rollback.php.

◆ $registry

$registry = $objectManager->get(Registry::class)

Definition at line 30 of file website_attribute_sync_rollback.php.

◆ $resourceConnection

$resourceConnection = $objectManager->get(ResourceConnection::class)

Definition at line 25 of file website_attribute_sync_rollback.php.

◆ $store

$store = $storeRepository->get('customstoreview1')

Definition at line 44 of file website_attribute_sync_rollback.php.

◆ $storeCodes

if ( $product->getId()) catch (\Magento\Framework\Exception\NoSuchEntityException $e) $storeCodes
Initial value:
= [
'customstoreview1',
'customstoreview2',
]

Remove stores by code

Definition at line 60 of file website_attribute_sync_rollback.php.

◆ $storeGroupId

$storeGroupId = $store->getStoreGroupId()

Definition at line 45 of file website_attribute_sync_rollback.php.

◆ $storeRepository

$storeRepository = $objectManager->get(StoreRepositoryInterface::class)

Definition at line 24 of file website_attribute_sync_rollback.php.

◆ $website

$website = Bootstrap::getObjectManager()->create(\Magento\Store\Model\Website::class)

Definition at line 86 of file website_attribute_sync_rollback.php.

◆ $websiteId

$websiteId = $store->getWebsiteId()

Definition at line 46 of file website_attribute_sync_rollback.php.

◆ try

try