123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <?php
- /**
- * Created by PhpStorm.
- * User: JZ
- * Date: 2019/7/19
- * Time: 9:34
- */
- class Attachment implements JsonSerializable {
- private $id;
- private $title;
- private $required;
- private $needSign;
- 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 getId()
- {
- return $this->id;
- }
- /**
- * @param mixed $id
- */
- public function setId($id)
- {
- $this->id = $id;
- }
- /**
- * @return mixed
- */
- public function getTitle()
- {
- return $this->title;
- }
- /**
- * @param mixed $title
- */
- public function setTitle($title)
- {
- $this->title = $title;
- }
- /**
- * @return mixed
- */
- public function getRequired()
- {
- return $this->required;
- }
- /**
- * @param mixed $required
- */
- public function setRequired($required)
- {
- $this->required = $required;
- }
- /**
- * @return mixed
- */
- public function getNeedSign()
- {
- return $this->needSign;
- }
- /**
- * @param mixed $needSign
- */
- public function setNeedSign($needSign)
- {
- $this->needSign = $needSign;
- }
- }
|