2014-03-20 16:27:19 +02:00
|
|
|
<?php
|
|
|
|
|
/**
|
2014-05-05 13:06:53 +04:00
|
|
|
* This file is part of PHPWord - A pure PHP library for reading and writing
|
|
|
|
|
* word processing documents.
|
|
|
|
|
*
|
|
|
|
|
* PHPWord is free software distributed under the terms of the GNU Lesser
|
|
|
|
|
* General Public License version 3 as published by the Free Software Foundation.
|
|
|
|
|
*
|
|
|
|
|
* For the full copyright and license information, please read the LICENSE
|
|
|
|
|
* file that was distributed with this source code. For the full list of
|
|
|
|
|
* contributors, visit https://github.com/PHPOffice/PHPWord/contributors.
|
2014-03-20 16:27:19 +02:00
|
|
|
*
|
2017-11-04 22:44:12 +01:00
|
|
|
* @see https://github.com/PHPOffice/PHPWord
|
2018-03-08 23:52:25 +01:00
|
|
|
* @copyright 2010-2018 PHPWord contributors
|
2014-05-04 21:03:28 +04:00
|
|
|
* @license http://www.gnu.org/licenses/lgpl.txt LGPL version 3
|
2014-03-20 16:27:19 +02:00
|
|
|
*/
|
|
|
|
|
|
2014-03-31 01:13:02 +07:00
|
|
|
namespace PhpOffice\PhpWord\Element;
|
2014-03-30 01:30:25 +07:00
|
|
|
|
2021-01-01 16:09:16 +01:00
|
|
|
use PhpOffice\PhpWord\Shared\Text as SharedText;
|
2014-05-04 00:57:44 +07:00
|
|
|
|
2014-03-20 16:27:19 +02:00
|
|
|
/**
|
2014-03-30 01:30:25 +07:00
|
|
|
* Check box element
|
2014-06-16 00:09:14 +07:00
|
|
|
*
|
|
|
|
|
* @since 0.10.0
|
2014-03-20 16:27:19 +02:00
|
|
|
*/
|
2014-04-28 23:33:26 +07:00
|
|
|
class CheckBox extends Text
|
2014-03-20 16:27:19 +02:00
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Name content
|
|
|
|
|
*
|
|
|
|
|
* @var string
|
|
|
|
|
*/
|
|
|
|
|
private $name;
|
2014-03-30 01:30:25 +07:00
|
|
|
|
2014-03-20 16:27:19 +02:00
|
|
|
/**
|
2014-04-28 23:33:26 +07:00
|
|
|
* Create new instance
|
2014-03-20 16:27:19 +02:00
|
|
|
*
|
2014-03-27 10:17:07 +02:00
|
|
|
* @param string $name
|
2014-03-20 16:27:19 +02:00
|
|
|
* @param string $text
|
2014-03-30 18:51:25 +07:00
|
|
|
* @param mixed $fontStyle
|
|
|
|
|
* @param mixed $paragraphStyle
|
2014-03-20 16:27:19 +02:00
|
|
|
*/
|
|
|
|
|
public function __construct($name = null, $text = null, $fontStyle = null, $paragraphStyle = null)
|
|
|
|
|
{
|
|
|
|
|
$this->setName($name);
|
2014-04-28 23:33:26 +07:00
|
|
|
parent::__construct($text, $fontStyle, $paragraphStyle);
|
2014-03-20 16:27:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2014-03-30 14:15:23 +07:00
|
|
|
* Set name content
|
|
|
|
|
*
|
2014-03-20 16:27:19 +02:00
|
|
|
* @param string $name
|
2014-04-28 23:33:26 +07:00
|
|
|
* @return self
|
2014-03-20 16:27:19 +02:00
|
|
|
*/
|
2014-03-27 10:17:07 +02:00
|
|
|
public function setName($name)
|
2014-03-20 16:27:19 +02:00
|
|
|
{
|
2021-01-01 16:09:16 +01:00
|
|
|
$this->name = SharedText::toUTF8($name);
|
2014-04-28 23:33:26 +07:00
|
|
|
|
2014-03-20 16:27:19 +02:00
|
|
|
return $this;
|
|
|
|
|
}
|
|
|
|
|
|
2014-03-30 01:30:25 +07:00
|
|
|
/**
|
|
|
|
|
* Get name content
|
|
|
|
|
*
|
|
|
|
|
* @return string
|
|
|
|
|
*/
|
|
|
|
|
public function getName()
|
|
|
|
|
{
|
|
|
|
|
return $this->name;
|
|
|
|
|
}
|
2014-03-20 16:27:19 +02:00
|
|
|
}
|