You are here

public function PHPExcel_Worksheet::rebindParent in Loft Data Grids 6.2

Same name and namespace in other branches
  1. 7.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php \PHPExcel_Worksheet::rebindParent()

Re-bind parent

Parameters

PHPExcel $parent:

Return value

PHPExcel_Worksheet

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Worksheet.php, line 796

Class

PHPExcel_Worksheet
PHPExcel_Worksheet

Code

public function rebindParent(PHPExcel $parent) {
  if ($this->_parent !== null) {
    $namedRanges = $this->_parent
      ->getNamedRanges();
    foreach ($namedRanges as $namedRange) {
      $parent
        ->addNamedRange($namedRange);
    }
    $this->_parent
      ->removeSheetByIndex($this->_parent
      ->getIndex($this));
  }
  $this->_parent = $parent;
  return $this;
}