protected function parseCell(Table $table, Column $column, $lineIndex, $yamlCell, Scope $scope, $lineIteration = 0)
 {
     $lines = $table->getLines();
     if (is_array($yamlCell) && array_key_exists('foreach', $yamlCell)) {
         return $this->parseForeach($yamlCell, $scope, [$this, 'parseCell'], [$table, $column, $lineIndex + $lineIteration]);
     } else {
         $this->createCell($table, $column, $lines[$lineIndex + $lineIteration], $yamlCell, $scope);
         return 1;
     }
 }
Example #2
0
 private function processColumn(Table $table, $columnIndex, Column $column, PHPExcel_Worksheet $phpExcelSheet, &$lineOffset)
 {
     // Column header
     if ($table->displayColumnsLabel()) {
         $phpExcelSheet->setCellValueByColumnAndRow($columnIndex, $lineOffset - 1, $column->getLabel());
     }
     // Lines
     foreach ($table->getLines() as $lineIndex => $line) {
         // Cell
         $cell = $table->getCell($line, $column);
         if ($cell !== null) {
             $phpExcelSheet->setCellValueByColumnAndRow($columnIndex, $lineOffset + $lineIndex, $cell->getContent());
         }
     }
 }