Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions
PriceProvider Class Reference

Public Member Functions

 getPrice ($productIndex)
 

Detailed Description

Random price provider for fixtures

Definition at line 12 of file PriceProvider.php.

Member Function Documentation

◆ getPrice()

getPrice (   $productIndex)

Get random price for product

Parameters
int$productIndex
Returns
float

Definition at line 20 of file PriceProvider.php.

21  {
22  mt_srand($productIndex);
23  switch (mt_rand(0, 3)) {
24  case 0:
25  return 9.99;
26  case 1:
27  return 5;
28  case 2:
29  return 1;
30  case 3:
31  return mt_rand(1, 10000) / 10;
32  }
33  }

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