Definition at line 14 of file Generator.php.
◆ __construct()
__construct |
( |
array |
$rowPattern, |
|
|
|
$limit |
|
) |
| |
Read the row pattern to determine which columns are dynamic, set the collection size
- Parameters
-
array | $rowPattern | |
int | $limit | how many records to generate |
Definition at line 41 of file Generator.php.
43 foreach ($rowPattern as $key =>
$value) {
45 $this->_dynamicColumns[$key] =
$value;
48 $this->_pattern = $rowPattern;
49 $this->_limit = (int)$limit;
50 parent::__construct(array_keys($rowPattern));
◆ _getNextRow()
Render next row
Return array or false on error
- Returns
- array|false
Definition at line 70 of file Generator.php.
73 foreach ($this->_dynamicColumns as $key => $dynamicValue) {
75 if (is_callable($dynamicValue)) {
78 $row[$key] = str_replace(
'%s',
$index, $dynamicValue);
call_user_func($callable, $param)
◆ valid()
Whether limit of generated elements is reached (according to "Iterator" interface)
- Returns
- bool
Definition at line 58 of file Generator.php.
◆ $_dynamicColumns
◆ $_limit
◆ $_pattern
The documentation for this class was generated from the following file:
- vendor/magento/magento2-base/setup/src/Magento/Setup/Model/Generator.php