Company.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: JZ
  5. * Date: 2019/7/19
  6. * Time: 9:35
  7. */
  8. class Company implements JsonSerializable {
  9. private $id; //公司Id
  10. private $name; //公司名称
  11. private $registerNo; //公司注册号
  12. private $status; //公司状态
  13. public function jsonSerialize() {
  14. $data = [];
  15. foreach ($this as $key=>$val){
  16. if ($val !== null) $data[$key] = $val;
  17. }
  18. if(sizeof($data) < 1){
  19. return null;
  20. }
  21. return $data;
  22. }
  23. /**
  24. * @return mixed
  25. */
  26. public function getId()
  27. {
  28. return $this->id;
  29. }
  30. /**
  31. * @param mixed $id
  32. */
  33. public function setId($id)
  34. {
  35. $this->id = $id;
  36. }
  37. /**
  38. * @return mixed
  39. */
  40. public function getName()
  41. {
  42. return $this->name;
  43. }
  44. /**
  45. * @param mixed $name
  46. */
  47. public function setName($name)
  48. {
  49. $this->name = $name;
  50. }
  51. /**
  52. * @return mixed
  53. */
  54. public function getRegisterNo()
  55. {
  56. return $this->registerNo;
  57. }
  58. /**
  59. * @param mixed $registerNo
  60. */
  61. public function setRegisterNo($registerNo)
  62. {
  63. $this->registerNo = $registerNo;
  64. }
  65. /**
  66. * @return mixed
  67. */
  68. public function getStatus()
  69. {
  70. return $this->status;
  71. }
  72. /**
  73. * @param mixed $status
  74. */
  75. public function setStatus($status)
  76. {
  77. $this->status = $status;
  78. }
  79. }