Subfamilly.php 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  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. use AppBundle\Entity\Traits\TimestampableEntity;
  8. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  9. /**
  10. * Enum des sous-familles d'art, sous-type de Familly
  11. *
  12. * @Iri("http://schema.org/Subfamilly")
  13. */
  14. #[ORM\Entity]
  15. class Subfamilly
  16. {
  17. use TimestampableEntity;
  18. use CreatorUpdaterEntity;
  19. /**
  20. * @var int
  21. */
  22. #[ORM\Column(type: 'integer')]
  23. #[ORM\Id]
  24. #[ORM\GeneratedValue(strategy: 'AUTO')]
  25. #[Groups(['subfamilly', 'categories_reference'])]
  26. private $id;
  27. /**
  28. * @var string
  29. */
  30. #[ORM\Column(type: 'string')]
  31. #[Assert\Type(type: 'string')]
  32. #[Assert\NotNull]
  33. #[Groups(['subfamilly', 'categories_reference_subfamilly'])]
  34. private $name;
  35. /**
  36. * @var string
  37. */
  38. #[ORM\Column(type: 'string')]
  39. #[Assert\Type(type: 'string')]
  40. #[Assert\NotNull]
  41. #[Groups(['subfamilly'])]
  42. private $code;
  43. /**
  44. * Sets id.
  45. *
  46. * @param int $id
  47. *
  48. * @return $this
  49. */
  50. public function setId($id)
  51. {
  52. $this->id = $id;
  53. return $this;
  54. }
  55. /**
  56. * Gets id.
  57. *
  58. * @return int
  59. */
  60. public function getId()
  61. {
  62. return $this->id;
  63. }
  64. /**
  65. * Sets name.
  66. *
  67. * @param string $name
  68. *
  69. * @return $this
  70. */
  71. public function setName($name)
  72. {
  73. $this->name = $name;
  74. return $this;
  75. }
  76. /**
  77. * Gets name.
  78. *
  79. * @return string
  80. */
  81. public function getName()
  82. {
  83. return $this->name;
  84. }
  85. /**
  86. * Sets code.
  87. *
  88. * @param string $code
  89. *
  90. * @return $this
  91. */
  92. public function setCode($code)
  93. {
  94. $this->code = $code;
  95. return $this;
  96. }
  97. /**
  98. * Gets code.
  99. *
  100. * @return string
  101. */
  102. public function getCode()
  103. {
  104. return $this->code;
  105. }
  106. /**
  107. * NEED THIS FOR ELASTICA TRANSLATABLE
  108. * @return null
  109. */
  110. public function getTranslatable(){
  111. return null;
  112. }
  113. }