Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Data Fields | Protected Member Functions | Protected Attributes
OrdersFixture Class Reference
Inheritance diagram for OrdersFixture:
Fixture

Public Member Functions

 __construct (\Magento\Store\Model\StoreManagerInterface $storeManager, \Magento\Catalog\Model\ResourceModel\Product\CollectionFactory $productCollectionFactory, \Magento\Catalog\Api\ProductRepositoryInterface $productRepository, \Magento\ConfigurableProduct\Api\OptionRepositoryInterface $optionRepository, \Magento\ConfigurableProduct\Api\LinkManagementInterface $linkManagement, \Magento\Framework\Serialize\SerializerInterface $serializer, FixtureModel $fixtureModel)
 
 getActionTitle ()
 
 introduceParamLabels ()
 
- Public Member Functions inherited from Fixture
 __construct (FixtureModel $fixtureModel)
 
 execute ()
 
 getActionTitle ()
 
 printInfo (OutputInterface $output)
 
 introduceParamLabels ()
 
 getPriority ()
 

Data Fields

const BATCH_SIZE = 1000
 
const BIG_CONFIGURABLE_TYPE = 'big_configurable'
 
const ORDER_SIMPLE_PRODUCT_COUNT_FROM = 2
 
const ORDER_SIMPLE_PRODUCT_COUNT_TO = 2
 
const ORDER_CONFIGURABLE_PRODUCT_COUNT_FROM = 0
 
const ORDER_CONFIGURABLE_PRODUCT_COUNT_TO = 0
 
const ORDER_BIG_CONFIGURABLE_PRODUCT_COUNT_FROM = 0
 
const ORDER_BIG_CONFIGURABLE_PRODUCT_COUNT_TO = 0
 

Protected Member Functions

 query ($table,... $replacements)
 

Protected Attributes

 $priority = 135
 
- Protected Attributes inherited from Fixture
 $priority
 
 $fixtureModel
 

Detailed Description

Fixture generator for Order entities with configurable number of different types of order items. Optionally generates inactive quotes for generated orders.

Support the following format:

<order_quotes_enable>{bool}</order_quotes_enable>

<order_simple_product_count_from>{int}</order_simple_product_count_from>

<order_simple_product_count_to>{int}</order_simple_product_count_to>

<order_configurable_product_count_from>{int}</order_configurable_product_count_from>

<order_configurable_product_count_to>{int}</order_configurable_product_count_to>

<order_big_configurable_product_count_from>{int}</order_big_configurable_product_count_from>

<order_big_configurable_product_count_to>{int}</order_big_configurable_product_count_to>

<orders>{int}</orders>

See also
setup/performance-toolkit/profiles/ce/small.xml

@SuppressWarnings(PHPMD.CouplingBetweenObjects)

Definition at line 45 of file OrdersFixture.php.

Constructor & Destructor Documentation

◆ __construct()

__construct ( \Magento\Store\Model\StoreManagerInterface  $storeManager,
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory  $productCollectionFactory,
\Magento\Catalog\Api\ProductRepositoryInterface  $productRepository,
\Magento\ConfigurableProduct\Api\OptionRepositoryInterface  $optionRepository,
\Magento\ConfigurableProduct\Api\LinkManagementInterface  $linkManagement,
\Magento\Framework\Serialize\SerializerInterface  $serializer,
FixtureModel  $fixtureModel 
)
Parameters
\Magento\Store\Model\StoreManagerInterface$storeManager
\Magento\Catalog\Model\ResourceModel\Product\CollectionFactory$productCollectionFactory
\Magento\Catalog\Api\ProductRepositoryInterface$productRepository
\Magento\ConfigurableProduct\Api\OptionRepositoryInterface$optionRepository
\Magento\ConfigurableProduct\Api\LinkManagementInterface$linkManagement
\Magento\Framework\Serialize\SerializerInterface$serializer
FixtureModel$fixtureModel

Definition at line 170 of file OrdersFixture.php.

178  {
179  $this->storeManager = $storeManager;
180  $this->productCollectionFactory = $productCollectionFactory;
181  $this->productRepository = $productRepository;
182  $this->optionRepository = $optionRepository;
183  $this->linkManagement = $linkManagement;
184  $this->serializer = $serializer;
185  parent::__construct($fixtureModel);
186  }
$storeManager

Member Function Documentation

◆ getActionTitle()

getActionTitle ( )

{}

Definition at line 723 of file OrdersFixture.php.

724  {
725  return 'Generating orders';
726  }

◆ introduceParamLabels()

introduceParamLabels ( )

{}

Definition at line 731 of file OrdersFixture.php.

732  {
733  return [
734  'orders' => 'Orders'
735  ];
736  }

◆ query()

query (   $table,
  $replacements 
)
protected

Build and execute query.

Builds a database query by replacing placeholder values in the cached queries and executes query in appropriate DB connection (if setup). Additionally filters out quote-related queries, if appropriate flag is set.

Parameters
string$table
array...$replacements
Returns
void

Definition at line 529 of file OrdersFixture.php.

530  {
531  if (!$this->orderQuotesEnable && strpos($table, "quote") !== false) {
532  return;
533  }
534  $query = $this->queryTemplates[$table];
535  foreach ($replacements as $data) {
536  $query = str_replace(array_keys($data), array_values($data), $query);
537  }
538 
539  $this->resourceConnections[$table]->query($query);
540  }
$table
Definition: trigger.php:14

Field Documentation

◆ $priority

$priority = 135
protected

Definition at line 108 of file OrdersFixture.php.

◆ BATCH_SIZE

const BATCH_SIZE = 1000

Definition at line 52 of file OrdersFixture.php.

◆ BIG_CONFIGURABLE_TYPE

const BIG_CONFIGURABLE_TYPE = 'big_configurable'

Definition at line 59 of file OrdersFixture.php.

◆ ORDER_BIG_CONFIGURABLE_PRODUCT_COUNT_FROM

const ORDER_BIG_CONFIGURABLE_PRODUCT_COUNT_FROM = 0

Definition at line 94 of file OrdersFixture.php.

◆ ORDER_BIG_CONFIGURABLE_PRODUCT_COUNT_TO

const ORDER_BIG_CONFIGURABLE_PRODUCT_COUNT_TO = 0

Definition at line 101 of file OrdersFixture.php.

◆ ORDER_CONFIGURABLE_PRODUCT_COUNT_FROM

const ORDER_CONFIGURABLE_PRODUCT_COUNT_FROM = 0

Definition at line 80 of file OrdersFixture.php.

◆ ORDER_CONFIGURABLE_PRODUCT_COUNT_TO

const ORDER_CONFIGURABLE_PRODUCT_COUNT_TO = 0

Definition at line 87 of file OrdersFixture.php.

◆ ORDER_SIMPLE_PRODUCT_COUNT_FROM

const ORDER_SIMPLE_PRODUCT_COUNT_FROM = 2

Definition at line 66 of file OrdersFixture.php.

◆ ORDER_SIMPLE_PRODUCT_COUNT_TO

const ORDER_SIMPLE_PRODUCT_COUNT_TO = 2

Definition at line 73 of file OrdersFixture.php.


The documentation for this class was generated from the following file: