PHPWord/src/PhpWord/Element/TextRun.php

52 lines
1.1 KiB
PHP
Raw Normal View History

2012-05-06 18:25:40 +02:00
<?php
/**
* PHPWord
2012-05-06 18:25:40 +02:00
*
2014-03-27 23:55:06 +07:00
* @link https://github.com/PHPOffice/PHPWord
* @copyright 2014 PHPWord
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
2012-05-06 18:25:40 +02:00
*/
namespace PhpOffice\PhpWord\Element;
2013-12-16 06:40:30 -05:00
use PhpOffice\PhpWord\Container\Container;
use PhpOffice\PhpWord\Style\Paragraph;
/**
* Textrun/paragraph element
*/
class TextRun extends Container
{
2013-12-16 06:40:30 -05:00
/**
* Paragraph style
*
* @var string|Paragraph
2013-12-16 06:40:30 -05:00
*/
private $paragraphStyle;
2013-12-16 06:40:30 -05:00
/**
* Create new instance
2013-12-16 06:40:30 -05:00
*
* @param string|array|Paragraph $paragraphStyle
* @param string $docPartType section|header|footer
* @param int $docPartId
2013-12-16 06:40:30 -05:00
*/
public function __construct($paragraphStyle = null, $docPart = 'section', $docPartId = 1)
2013-12-16 06:40:30 -05:00
{
$this->container = 'textrun';
$this->docPart = $docPart;
$this->docPartId = $docPartId;
2014-04-03 08:44:41 +07:00
$this->paragraphStyle = $this->setStyle(new Paragraph(), $paragraphStyle);
2014-03-11 16:44:22 -06:00
}
2013-12-16 06:40:30 -05:00
/**
* Get Paragraph style
*
2014-03-30 18:51:25 +07:00
* @return string|Paragraph
2013-12-16 06:40:30 -05:00
*/
public function getParagraphStyle()
{
return $this->paragraphStyle;
}
}