_fillType = PHPPowerPoint_Style_Fill::FILL_NONE; $this->_rotation = 0; $this->_startColor = new PHPPowerPoint_Style_Color(PHPPowerPoint_Style_Color::COLOR_WHITE); $this->_endColor = new PHPPowerPoint_Style_Color(PHPPowerPoint_Style_Color::COLOR_BLACK); } /** * Get Fill Type * * @return string */ public function getFillType() { $this->_fillType; } /** * Set Fill Type * * @param string $pValue PHPPowerPoint_Style_Fill fill type */ public function setFillType($pValue = PHPPowerPoint_Style_Fill::FILL_NONE) { $this->_fillType = $pValue; } /** * Get Rotation * * @return double */ public function getRotation() { return $this->_rotation; } /** * Set Rotation * * @param double $pValue */ public function setRotation($pValue = 0) { $this->_rotation = $pValue; } /** * Get Start Color * * @return PHPPowerPoint_Style_Color */ public function getStartColor() { // It's a get but it may lead to a modified color which we won't detect but in which case we must bind. // So bind as an assurance. return $this->_startColor; } /** * Set Start Color * * @param PHPPowerPoint_Style_Color $pValue * @throws Exception */ public function setStartColor(PHPPowerPoint_Style_Color $pValue = null) { $this->_startColor = $pValue; } /** * Get End Color * * @return PHPPowerPoint_Style_Color */ public function getEndColor() { // It's a get but it may lead to a modified color which we won't detect but in which case we must bind. // So bind as an assurance. return $this->_endColor; } /** * Set End Color * * @param PHPPowerPoint_Style_Color $pValue * @throws Exception */ public function setEndColor(PHPPowerPoint_Style_Color $pValue = null) { $this->_endColor = $pValue; } /** * Get hash code * * @return string Hash code */ public function getHashCode() { return md5( $this->getFillType() . $this->getRotation() . $this->getStartColor()->getHashCode() . $this->getEndColor()->getHashCode() . __CLASS__ ); } /** * Hash index * * @var string */ private $_hashIndex; /** * Get hash index * * Note that this index may vary during script execution! Only reliable moment is * while doing a write of a workbook and when changes are not allowed. * * @return string Hash index */ public function getHashIndex() { return $this->_hashIndex; } /** * Set hash index * * Note that this index may vary during script execution! Only reliable moment is * while doing a write of a workbook and when changes are not allowed. * * @param string $value Hash index */ public function setHashIndex($value) { $this->_hashIndex = $value; } /** * Implement PHP __clone to create a deep clone, not just a shallow copy. */ public function __clone() { $vars = get_object_vars($this); foreach ($vars as $key => $value) { if (is_object($value)) { $this->$key = clone $value; } else { $this->$key = $value; } } } }