Наследование: implements PhpOffice\PhpPresentation\Shape\RichText\TextElementInterface
Пример #1
0
 public function testText()
 {
     $object = new TextElement();
     $this->assertEquals('', $object->getText());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setText());
     $this->assertEquals('', $object->getText());
     $this->assertInstanceOf('PhpOffice\\PhpPresentation\\Shape\\RichText\\TextElement', $object->setText('AAA'));
     $this->assertEquals('AAA', $object->getText());
 }
Пример #2
0
 /**
  * Write hyperlink
  *
  * @param \PhpOffice\Common\XMLWriter                               $objWriter XML Writer
  * @param \PhpOffice\PhpPresentation\AbstractShape|\PhpOffice\PhpPresentation\Shape\RichText\TextElement $shape
  */
 protected function writeHyperlink(XMLWriter $objWriter, $shape)
 {
     // a:hlinkClick
     $objWriter->startElement('a:hlinkClick');
     $objWriter->writeAttribute('r:id', $shape->getHyperlink()->relationId);
     $objWriter->writeAttribute('tooltip', $shape->getHyperlink()->getTooltip());
     if ($shape->getHyperlink()->isInternal()) {
         $objWriter->writeAttribute('action', $shape->getHyperlink()->getUrl());
     }
     $objWriter->endElement();
 }