You are here

public function PHPExcel::copy in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel.php \PHPExcel::copy()

Copy workbook (!= clone!)

Return value

PHPExcel

File

vendor/phpoffice/phpexcel/Classes/PHPExcel.php, line 848

Class

PHPExcel
PHPExcel

Code

public function copy() {
  $copied = clone $this;
  $worksheetCount = count($this->_workSheetCollection);
  for ($i = 0; $i < $worksheetCount; ++$i) {
    $this->_workSheetCollection[$i] = $this->_workSheetCollection[$i]
      ->copy();
    $this->_workSheetCollection[$i]
      ->rebindParent($this);
  }
  return $copied;
}