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 2.0KB

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