ContractCustomField.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <?php
  2. /**
  3. * 合同自定义参数
  4. */
  5. class ContractCustomField implements JsonSerializable {
  6. private $key;
  7. private $name;
  8. private $value;
  9. public function jsonSerialize() {
  10. $data = [];
  11. foreach ($this as $key=>$val){
  12. if ($val !== null) $data[$key] = $val;
  13. }
  14. if(sizeof($data) < 1){
  15. return null;
  16. }
  17. return $data;
  18. }
  19. /**
  20. * @return mixed
  21. */
  22. public function getKey()
  23. {
  24. return $this->key;
  25. }
  26. /**
  27. * @param mixed $key
  28. */
  29. public function setKey($key)
  30. {
  31. $this->key = $key;
  32. }
  33. /**
  34. * @return mixed
  35. */
  36. public function getName()
  37. {
  38. return $this->name;
  39. }
  40. /**
  41. * @param mixed $name
  42. */
  43. public function setName($name)
  44. {
  45. $this->name = $name;
  46. }
  47. /**
  48. * @return mixed
  49. */
  50. public function getValue()
  51. {
  52. return $this->value;
  53. }
  54. /**
  55. * @param mixed $value
  56. */
  57. public function setValue($value)
  58. {
  59. $this->value = $value;
  60. }
  61. }