You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LuParameterDbo.php 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115
  1. <?php
  2. /**
  3. * Created by PhpStorm.
  4. * User: robin
  5. * Date: 5/29/16
  6. * Time: 7:48 PM
  7. */
  8. namespace Luticate\Utils\Dbo;
  9. class LuParameterDbo extends LuDbo
  10. {
  11. /**
  12. * @var $_summary string
  13. */
  14. private $_summary = "";
  15. /**
  16. * @return string
  17. */
  18. public function getSummary()
  19. {
  20. return $this->_summary;
  21. }
  22. /**
  23. * @param string $summary
  24. */
  25. public function setSummary($summary)
  26. {
  27. $this->_summary = $summary;
  28. }
  29. /**
  30. * @var $_type string
  31. */
  32. private $_type = "";
  33. /**
  34. * @var $_name string
  35. */
  36. private $_name = "";
  37. /**
  38. * @return string
  39. */
  40. public function getType()
  41. {
  42. return $this->_type;
  43. }
  44. /**
  45. * @param string $type
  46. */
  47. public function setType($type)
  48. {
  49. $this->_type = $type;
  50. }
  51. /**
  52. * @return string
  53. */
  54. public function getName()
  55. {
  56. return $this->_name;
  57. }
  58. /**
  59. * @param string $name
  60. */
  61. public function setName($name)
  62. {
  63. $this->_name = $name;
  64. }
  65. /**
  66. * @return LuParameterConstraintDbo[]
  67. */
  68. public function getConstraints()
  69. {
  70. return $this->_constraints;
  71. }
  72. /**
  73. * @param LuParameterConstraintDbo[] $constraints
  74. */
  75. public function setConstraints($constraints)
  76. {
  77. $this->_constraints = $constraints;
  78. }
  79. public function addConstraint($constraint)
  80. {
  81. $this->_constraints[] = $constraint;
  82. }
  83. /**
  84. * @var $_constraints LuParameterConstraintDbo[]
  85. */
  86. private $_constraints = [];
  87. function jsonSerialize()
  88. {
  89. $constraints = [];
  90. foreach ($this->_constraints as $constraint) {
  91. $constraints[] = $constraint->jsonSerialize();
  92. }
  93. return [
  94. "Name" => $this->_name,
  95. "Type" => $this->_type,
  96. "Summary" => $this->_summary,
  97. "Constraints" => $constraints
  98. ];
  99. }
  100. }