123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124 |
- <?php
- /**
- * Created by PhpStorm.
- * user: JZ
- * Date: 2019/7/13
- * Time: 13:06
- */
- class Document implements JsonSerializable {
- private $id;
- private $title;
- private $pageCount;
- private $createTime;
- private $contentType;
- private $params;
- 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 getPageCount()
- {
- return $this->pageCount;
- }
- /**
- * @param mixed $pageCount
- */
- public function setPageCount($pageCount)
- {
- $this->pageCount = $pageCount;
- }
- /**
- * @return mixed
- */
- public function getCreateTime()
- {
- return $this->createTime;
- }
- /**
- * @param mixed $createTime
- */
- public function setCreateTime($createTime)
- {
- $this->createTime = $createTime;
- }
- /**
- * @return mixed
- */
- public function getParams()
- {
- return $this->params;
- }
- /**
- * @param mixed $params
- */
- public function setParams($params)
- {
- $this->params = $params;
- }
- /**
- * @return mixed
- */
- public function getContentType()
- {
- return $this->contentType;
- }
- /**
- * @param mixed $contentType
- */
- public function setContentType($contentType)
- {
- $this->contentType = $contentType;
- }
- }
|