Example #1
0
 /**
  * Write Border
  *
  * @param 	Shared_XMLWriter			$objWriter 		XML Writer
  * @param 	Style_Borders				$pBorders		Borders style
  * @throws 	Exception
  */
 private function _writeBorder(Shared_XMLWriter $objWriter = null, Style_Borders $pBorders = null)
 {
     // Write border
     $objWriter->startElement('border');
     // Diagonal?
     switch ($pBorders->getDiagonalDirection()) {
         case Style_Borders::DIAGONAL_UP:
             $objWriter->writeAttribute('diagonalUp', 'true');
             $objWriter->writeAttribute('diagonalDown', 'false');
             break;
         case Style_Borders::DIAGONAL_DOWN:
             $objWriter->writeAttribute('diagonalUp', 'false');
             $objWriter->writeAttribute('diagonalDown', 'true');
             break;
         case Style_Borders::DIAGONAL_BOTH:
             $objWriter->writeAttribute('diagonalUp', 'true');
             $objWriter->writeAttribute('diagonalDown', 'true');
             break;
     }
     // BorderPr
     $this->_writeBorderPr($objWriter, 'left', $pBorders->getLeft());
     $this->_writeBorderPr($objWriter, 'right', $pBorders->getRight());
     $this->_writeBorderPr($objWriter, 'top', $pBorders->getTop());
     $this->_writeBorderPr($objWriter, 'bottom', $pBorders->getBottom());
     $this->_writeBorderPr($objWriter, 'diagonal', $pBorders->getDiagonal());
     $objWriter->endElement();
 }