src/Entity/Declaration/Usage.php line 14

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Declaration;
  3. use ApiPlatform\Core\Annotation\ApiResource;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. /**
  7. * @ORM\Entity
  8. * @ORM\Table(name="brunex_declaration_usage")
  9. * @ApiResource(routePrefix="/brunex/declaration")
  10. */
  11. class Usage
  12. {
  13. /**
  14. * @var int
  15. * @ORM\Id
  16. * @ORM\GeneratedValue
  17. * @ORM\Column(type="integer")
  18. * @Groups({"declaration"})
  19. */
  20. protected $id;
  21. /**
  22. * @var string
  23. * @ORM\Column(type="text")
  24. * @Groups({"declaration"})
  25. */
  26. protected $value = '';
  27. /**
  28. * @var Field
  29. * @ORM\ManyToOne(targetEntity="Field")
  30. * @Groups({"declaration"})
  31. */
  32. protected $field;
  33. /**
  34. * @var Definition
  35. * @ORM\ManyToOne(targetEntity="Definition")
  36. * @Groups({"declaration"})
  37. */
  38. protected $definition;
  39. /**
  40. * @var Declaration
  41. * @ORM\ManyToOne(targetEntity="Declaration", inversedBy="usages")
  42. * @ORM\JoinColumn(onDelete="CASCADE")
  43. */
  44. protected $declaration;
  45. /**
  46. * @param int $id
  47. */
  48. public function setId($id): void
  49. {
  50. $this->id = $id;
  51. }
  52. /**
  53. * @return int
  54. */
  55. public function getId()
  56. {
  57. return $this->id;
  58. }
  59. /**
  60. * @return string
  61. */
  62. public function getValue()
  63. {
  64. return $this->value;
  65. }
  66. /**
  67. * @param string $value
  68. *
  69. * @return Usage
  70. */
  71. public function setValue($value)
  72. {
  73. $this->value = $value;
  74. return $this;
  75. }
  76. /**
  77. * @return Field
  78. */
  79. public function getField()
  80. {
  81. return $this->field;
  82. }
  83. /**
  84. * @param Field $field
  85. *
  86. * @return Usage
  87. */
  88. public function setField($field)
  89. {
  90. $this->field = $field;
  91. return $this;
  92. }
  93. /**
  94. * @return Definition
  95. */
  96. public function getDefinition()
  97. {
  98. return $this->definition;
  99. }
  100. /**
  101. * @param Definition $definition
  102. *
  103. * @return Usage
  104. */
  105. public function setDefinition($definition)
  106. {
  107. $this->definition = $definition;
  108. return $this;
  109. }
  110. /**
  111. * @return Declaration
  112. */
  113. public function getDeclaration()
  114. {
  115. return $this->declaration;
  116. }
  117. /**
  118. * @param Declaration $declaration
  119. *
  120. * @return Usage
  121. */
  122. public function setDeclaration($declaration)
  123. {
  124. $this->declaration = $declaration;
  125. return $this;
  126. }
  127. }