Attachment.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: JZ
  5. * Date: 2019/7/19
  6. * Time: 9:34
  7. */
  8. class Attachment implements JsonSerializable {
  9. private $id;
  10. private $title;
  11. private $required;
  12. private $needSign;
  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 getTitle()
  41. {
  42. return $this->title;
  43. }
  44. /**
  45. * @param mixed $title
  46. */
  47. public function setTitle($title)
  48. {
  49. $this->title = $title;
  50. }
  51. /**
  52. * @return mixed
  53. */
  54. public function getRequired()
  55. {
  56. return $this->required;
  57. }
  58. /**
  59. * @param mixed $required
  60. */
  61. public function setRequired($required)
  62. {
  63. $this->required = $required;
  64. }
  65. /**
  66. * @return mixed
  67. */
  68. public function getNeedSign()
  69. {
  70. return $this->needSign;
  71. }
  72. /**
  73. * @param mixed $needSign
  74. */
  75. public function setNeedSign($needSign)
  76. {
  77. $this->needSign = $needSign;
  78. }
  79. }