Familly.php 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. <?php
  2. namespace AppBundle\Entity\Core;
  3. use Doctrine\ORM\Mapping as ORM;
  4. use Dunglas\ApiBundle\Annotation\Iri;
  5. use Symfony\Component\Serializer\Annotation\Groups;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. /**
  8. * Enum des types d'art
  9. *
  10. * @Iri("http://schema.org/Familly")
  11. */
  12. #[ORM\Entity]
  13. class Familly
  14. {
  15. /**
  16. * @var int
  17. */
  18. #[ORM\Column(type: 'integer')]
  19. #[ORM\Id]
  20. #[ORM\GeneratedValue(strategy: 'AUTO')]
  21. #[Groups(['familly', 'categories_reference'])]
  22. private $id;
  23. /**
  24. * @var string The name of the item.
  25. *
  26. * @Iri("https://schema.org/name")
  27. */
  28. #[ORM\Column(type: 'string')]
  29. #[Assert\Type(type: 'string')]
  30. #[Assert\NotNull]
  31. #[Groups(['familly', 'categories_reference_familly'])]
  32. private $name;
  33. /**
  34. * @var string
  35. */
  36. #[ORM\Column(type: 'string')]
  37. #[Assert\Type(type: 'string')]
  38. #[Assert\NotNull]
  39. #[Groups(['familly'])]
  40. private $code;
  41. /**
  42. * Sets id.
  43. *
  44. * @param int $id
  45. *
  46. * @return $this
  47. */
  48. public function setId($id)
  49. {
  50. $this->id = $id;
  51. return $this;
  52. }
  53. /**
  54. * Gets id.
  55. *
  56. * @return int
  57. */
  58. public function getId()
  59. {
  60. return $this->id;
  61. }
  62. /**
  63. * Sets name.
  64. *
  65. * @param string $name
  66. *
  67. * @return $this
  68. */
  69. public function setName($name)
  70. {
  71. $this->name = $name;
  72. return $this;
  73. }
  74. /**
  75. * Gets name.
  76. *
  77. * @return string
  78. */
  79. public function getName()
  80. {
  81. return $this->name;
  82. }
  83. /**
  84. * Sets code.
  85. *
  86. * @param string $code
  87. *
  88. * @return $this
  89. */
  90. public function setCode($code)
  91. {
  92. $this->code = $code;
  93. return $this;
  94. }
  95. /**
  96. * Gets code.
  97. *
  98. * @return string
  99. */
  100. public function getCode()
  101. {
  102. return $this->code;
  103. }
  104. /**
  105. * NEED THIS FOR ELASTICA TRANSLATABLE
  106. * @return null
  107. */
  108. public function getTranslatable(){
  109. return null;
  110. }
  111. }