123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- /**
- * Created by PhpStorm.
- * user: JZ
- * Date: 2019/7/13
- * Time: 12:42
- */
- class TemplateParam implements JsonSerializable {
- private $name; // 文档参数名称
- private $value; // 文档参数默认填充值
- private $required; //是否必填
- private $type;
- public function jsonSerialize() {
- $data = [];
- foreach ($this as $key=>$val){
- if ($val !== null) $data[$key] = $val;
- }
- if(sizeof($data) < 1){
- return null;
- }
- return $data;
- }
- /**
- * @return mixed
- */
- public function getName()
- {
- return $this->name;
- }
- /**
- * @param mixed $name
- */
- public function setName($name)
- {
- $this->name = $name;
- }
- /**
- * @return mixed
- */
- public function getValue()
- {
- return $this->value;
- }
- /**
- * @param mixed $value
- */
- public function setValue($value)
- {
- $this->value = $value;
- }
- /**
- * @return mixed
- */
- public function getRequired()
- {
- return $this->required;
- }
- /**
- * @param mixed $required
- */
- public function setRequired($required)
- {
- $this->required = $required;
- }
- /**
- * @return mixed
- */
- public function getType()
- {
- return $this->type;
- }
- /**
- * @param mixed $type
- */
- public function setType($type)
- {
- $this->type = $type;
- }
- }
|