_horizontal = PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT; $this->_vertical = PHPPowerPoint_Style_Alignment::VERTICAL_BASE; $this->_level = 0; $this->_indent = 0; } /** * Get Horizontal * * @return string */ public function getHorizontal() { return $this->_horizontal; } /** * Set Horizontal * * @param string $pValue */ public function setHorizontal($pValue = PHPPowerPoint_Style_Alignment::HORIZONTAL_LEF) { if ($pValue == '') { $pValue = PHPPowerPoint_Style_Alignment::HORIZONTAL_LEFT; } $this->_horizontal = $pValue; } /** * Get Vertical * * @return string */ public function getVertical() { return $this->_vertical; } /** * Set Vertical * * @param string $pValue */ public function setVertical($pValue = PHPPowerPoint_Style_Alignment::VERTICAL_BASE) { if ($pValue == '') { $pValue = PHPPowerPoint_Style_Alignment::VERTICAL_BASE; } $this->_vertical = $pValue; } /** * Get Level * * @return int */ public function getLevel() { return $this->_level; } /** * Set Level * * @param int $pValue Ranging 0 - 8 * @throws Exception */ public function setLevel($pValue = 0) { if ($pValue < 0 || $pValue > 8) { throw new Exception("Invalid value: shoul be range 0 - 8."); } $this->_level = $pValue; } /** * Get indent * * @return int */ public function getIndent() { return $this->_indent; } /** * Set indent * * @param int $pValue */ public function setIndent($pValue = 0) { if ($pValue > 0) { if ($this->getHorizontal() != self::HORIZONTAL_GENERAL && $this->getHorizontal() != self::HORIZONTAL_LEFT && $this->getHorizontal() != self::HORIZONTAL_RIGHT) { $pValue = 0; // indent not supported } } $this->_indent = $pValue; } /** * Get hash code * * @return string Hash code */ public function getHashCode() { return md5( $this->_horizontal . $this->_vertical . $this->_level . $this->_indent . __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; } } } }