示例#1
0
 /**
  * @param \PHPExcel_Worksheet_Row $row
  */
 public function setDefaultAttributes($row)
 {
     $sheet = $row->getCellIterator()->current()->getWorksheet();
     foreach ($this->_standardAttributes as $standardAttribute) {
         if ($standardAttribute->column) {
             $this->_defaultAttributes[] = new Attribute(['cell' => $sheet->getCell($standardAttribute->column . $row->getRowIndex()), 'standardAttribute' => $standardAttribute]);
         }
     }
 }
示例#2
0
 /**
  * Process sheet row data
  * @param  \PHPExcel_Worksheet_Row $row 
  * @return array                       
  */
 protected function processRowData(\PHPExcel_Worksheet_Row $row)
 {
     $cellIterator = $row->getCellIterator();
     $cellIterator->setIterateOnlyExistingCells(false);
     // This loops all cells,
     $rowIndex = $row->getRowIndex();
     $rowData = [];
     foreach ($cellIterator as $cell) {
         $cellData = $this->processCellData($cell);
         $rowData[$cellData['column']] = $cellData['value'];
     }
     return ['rowIndex' => $rowIndex, 'data' => $rowData];
 }