API to set default row style (#290)

This commit is contained in:
Adrien Loison authored and GitHub committed 2016-08-16 21:18:44 -07:00
1 parent 584121d478
commit c94694cb60
4 files changed
+112 -2

No files matched your search

+15
View File
@@ -71,6 +71,21 @@ abstract class AbstractWriter implements WriterInterface
$this->resetRowStyleToDefault();
}
/**
* Sets the default styles for all rows added with "addRow".
* Overriding the default style instead of using "addRowWithStyle" improves performance by 20%.
* @see https://github.com/box/spout/issues/272
*
* @param Style\Style $defaultStyle
* @return AbstractWriter
*/
public function setDefaultRowStyle($defaultStyle)
{
$this->defaultRowStyle = $defaultStyle;
$this->resetRowStyleToDefault();
return $this;
}
/**
* @param \Box\Spout\Common\Helper\GlobalFunctionsHelper $globalFunctionsHelper
* @return AbstractWriter