/** * Read the row pattern to determine which columns are dynamic, set the collection size * * @param Pattern $rowPattern * @param int $count how many records to generate */ public function __construct(Pattern $rowPattern, $count) { $this->_pattern = $rowPattern; $this->_count = $count; $this->_patternRowsCount = $this->_pattern->getRowsCount(); $this->_limit = (int) $count * $this->_patternRowsCount; parent::__construct($this->_pattern->getHeaders()); }
/** * Write self data to file */ protected function _loadToFile() { $fp = fopen($this->_getTemporaryFilePath(), 'w'); fputcsv($fp, $this->_pattern->getHeaders()); foreach ($this as $value) { fputcsv($fp, $value); } fclose($fp); }