getAuthor() 공개 메소드

public getAuthor ( ) : Author
리턴 PhpOffice\PhpPresentation\Shape\Comment\Author
예제 #1
0
 public function testGetSetAuthor()
 {
     $object = new Comment();
     $oStub = $this->getMock('PhpOffice\\PhpPresentation\\Shape\\Comment\\Author');
     $this->assertNull($object->getAuthor());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Comment', $object->setAuthor($oStub));
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\Comment\\Author', $object->getAuthor());
 }
예제 #2
0
 /**
  * Write Comment
  * @param XMLWriter $objWriter
  * @param Comment $oShape
  */
 public function writeShapeComment(XMLWriter $objWriter, Comment $oShape)
 {
     // officeooo:annotation
     $objWriter->startElement('officeooo:annotation');
     $objWriter->writeAttribute('svg:x', number_format(CommonDrawing::pixelsToCentimeters($oShape->getOffsetX()), 2, '.', '') . 'cm');
     $objWriter->writeAttribute('svg:y', number_format(CommonDrawing::pixelsToCentimeters($oShape->getOffsetY()), 2, '.', '') . 'cm');
     if ($oShape->getAuthor() instanceof Comment\Author) {
         $objWriter->writeElement('dc:creator', $oShape->getAuthor()->getName());
     }
     $objWriter->writeElement('dc:date', date('Y-m-d\\TH:i:s', $oShape->getDate()));
     $objWriter->writeElement('text:p', $oShape->getText());
     // ## officeooo:annotation
     $objWriter->endElement();
 }