Commit 237dd751 authored by 梁俊杰's avatar 梁俊杰

支持链式操作

parent f490f534
...@@ -111,6 +111,7 @@ class Exporter ...@@ -111,6 +111,7 @@ class Exporter
->getProtection() ->getProtection()
->setLocked(Protection::PROTECTION_UNPROTECTED); ->setLocked(Protection::PROTECTION_UNPROTECTED);
} }
return $this;
} }
/** /**
...@@ -137,6 +138,7 @@ class Exporter ...@@ -137,6 +138,7 @@ class Exporter
$this->sheet = $this->reader->setActiveSheetIndexByName($name); $this->sheet = $this->reader->setActiveSheetIndexByName($name);
$this->sheetIndex = $this->reader->getActiveSheetIndex(); $this->sheetIndex = $this->reader->getActiveSheetIndex();
$this->resetRowIndex(); $this->resetRowIndex();
return $this;
} }
/** /**
...@@ -145,6 +147,7 @@ class Exporter ...@@ -145,6 +147,7 @@ class Exporter
private function resetRowIndex() private function resetRowIndex()
{ {
$this->beginRowIndex = 1; $this->beginRowIndex = 1;
return $this;
} }
/** /**
...@@ -162,6 +165,7 @@ class Exporter ...@@ -162,6 +165,7 @@ class Exporter
public function setBeginColumnChar($char = "A") public function setBeginColumnChar($char = "A")
{ {
$this->beginColumnChar = $char; $this->beginColumnChar = $char;
return $this;
} }
/**设置从哪一行开始填充数据 /**设置从哪一行开始填充数据
...@@ -170,6 +174,7 @@ class Exporter ...@@ -170,6 +174,7 @@ class Exporter
public function setBeginRowIndex($index = 1) public function setBeginRowIndex($index = 1)
{ {
$this->beginRowIndex = $index; $this->beginRowIndex = $index;
return $this;
} }
/** /**
...@@ -182,6 +187,7 @@ class Exporter ...@@ -182,6 +187,7 @@ class Exporter
$this->sheet = $this->reader->setActiveSheetIndex($sheetIndex); $this->sheet = $this->reader->setActiveSheetIndex($sheetIndex);
$this->sheetIndex = $sheetIndex; $this->sheetIndex = $sheetIndex;
$this->resetRowIndex(); $this->resetRowIndex();
return $this;
} }
/** /**
...@@ -212,6 +218,7 @@ class Exporter ...@@ -212,6 +218,7 @@ class Exporter
//美化样式 //美化样式
$this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1)); $this->applyStyle($this->beginColumnChar . $this->beginRowIndex . ":" . $this->sheet->getHighestColumn() . ($this->beginRowIndex + count($data) - 1));
$this->beginRowIndex += count($data); $this->beginRowIndex += count($data);
return $this;
} }
/** /**
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment