12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- <?php
- /**
- * Created by PhpStorm.
- * User: JZ
- * Date: 2019/7/19
- * Time: 9:35
- */
- class Company implements JsonSerializable {
- private $id; //公司Id
- private $name; //公司名称
- private $registerNo; //公司注册号
- private $status; //公司状态
-
- 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 getName()
- {
- return $this->name;
- }
- /**
- * @param mixed $name
- */
- public function setName($name)
- {
- $this->name = $name;
- }
- /**
- * @return mixed
- */
- public function getRegisterNo()
- {
- return $this->registerNo;
- }
- /**
- * @param mixed $registerNo
- */
- public function setRegisterNo($registerNo)
- {
- $this->registerNo = $registerNo;
- }
- /**
- * @return mixed
- */
- public function getStatus()
- {
- return $this->status;
- }
- /**
- * @param mixed $status
- */
- public function setStatus($status)
- {
- $this->status = $status;
- }
- }
|