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

Go to the source code of this file.

Variables

 $objectManager = \Magento\TestFramework\Helper\Bootstrap::getObjectManager()
 
 $storeManager = $objectManager->get(\Magento\Store\Model\StoreManager::class)
 
 $store = $storeManager->getStore('default')
 
 $productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class)
 
 $installer = $objectManager->get(\Magento\Catalog\Setup\CategorySetup::class)
 
 $attributeSetId = $installer->getAttributeSetId('catalog_product', 'Default')
 
 $product
 
 $productAction = $objectManager->get(\Magento\Catalog\Model\Product\Action::class)
 

Variable Documentation

◆ $attributeSetId

$attributeSetId = $installer->getAttributeSetId('catalog_product', 'Default')

Definition at line 17 of file simple_products.php.

◆ $installer

$installer = $objectManager->get(\Magento\Catalog\Setup\CategorySetup::class)

Definition at line 16 of file simple_products.php.

◆ $objectManager

Definition at line 10 of file simple_products.php.

◆ $product

$product
Initial value:
= $objectManager->create(\Magento\Catalog\Model\Product::class)
->setTypeId('simple')
->setId(1)
->setAttributeSetId($attributeSetId)
->setWebsiteIds([1])
->setName('Simple Product 1')
->setSku('simple1')
->setPrice(10)
->setVisibility(\Magento\Catalog\Model\Product\Visibility::VISIBILITY_BOTH)
->setStatus(\Magento\Catalog\Model\Product\Attribute\Source\Status::STATUS_ENABLED)
->setStockData([
'use_config_manage_stock' => 1,
'qty' => 100,
'is_qty_decimal' => 0,
'is_in_stock' => 1,
])
$attributeSetId
$objectManager

Definition at line 19 of file simple_products.php.

◆ $productAction

$productAction = $objectManager->get(\Magento\Catalog\Model\Product\Action::class)

Definition at line 36 of file simple_products.php.

◆ $productRepository

$productRepository = $objectManager->get(\Magento\Catalog\Api\ProductRepositoryInterface::class)

Definition at line 14 of file simple_products.php.

◆ $store

$store = $storeManager->getStore('default')

Definition at line 13 of file simple_products.php.

◆ $storeManager

$storeManager = $objectManager->get(\Magento\Store\Model\StoreManager::class)

Definition at line 12 of file simple_products.php.