107 lines
1.9 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;
use PhpOffice\PhpWord\Style\Font;
use PhpOffice\PhpWord\Style\Paragraph;
/**
* Link element
*/
class Link extends AbstractElement
{
/**
* Link source
*
* @var string
*/
2014-04-03 08:44:41 +07:00
private $source;
/**
* Link name
*
* @var string
*/
2014-04-03 08:44:41 +07:00
private $name;
/**
2014-04-03 08:44:41 +07:00
* Font style
*
* @var string|\PhpOffice\PhpWord\Style\Font
*/
2014-04-03 08:44:41 +07:00
private $fontStyle;
/**
* Paragraph style
*
* @var string|\PhpOffice\PhpWord\Style\Paragraph
*/
2014-04-03 08:44:41 +07:00
private $paragraphStyle;
/**
* Create a new Link Element
*
2014-03-17 07:26:25 +07:00
* @param string $linkSrc
* @param string $linkName
2014-04-03 08:44:41 +07:00
* @param mixed $fontStyle
* @param mixed $paragraphStyle
*/
2014-04-03 08:44:41 +07:00
public function __construct($linkSrc, $linkName = null, $fontStyle = null, $paragraphStyle = null)
{
2014-04-03 08:44:41 +07:00
$this->source = $linkSrc;
$this->name = $linkName;
$this->fontStyle = $this->setStyle(new Font('text'), $fontStyle);
$this->paragraphStyle = $this->setStyle(new Paragraph(), $paragraphStyle);
return $this;
}
/**
* Get Link source
*
* @return string
*/
public function getLinkSrc()
{
2014-04-03 08:44:41 +07:00
return $this->source;
}
/**
* Get Link name
*
* @return string
*/
public function getLinkName()
{
2014-04-03 08:44:41 +07:00
return $this->name;
}
/**
* Get Text style
*
* @return string|\PhpOffice\PhpWord\Style\Font
*/
public function getFontStyle()
{
2014-04-03 08:44:41 +07:00
return $this->fontStyle;
}
/**
* Get Paragraph style
*
* @return string|\PhpOffice\PhpWord\Style\Paragraph
*/
public function getParagraphStyle()
{
2014-04-03 08:44:41 +07:00
return $this->paragraphStyle;
}
2012-05-06 18:25:40 +02:00
}