PersonalizedList.php 4.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. <?php
  2. namespace AppBundle\Entity\AccessAndFunction;
  3. use AppBundle\Annotation\DefaultField;
  4. use Doctrine\ORM\Mapping as ORM;
  5. use Dunglas\ApiBundle\Annotation\Iri;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use Symfony\Component\Validator\Constraints as Assert;
  8. use AppBundle\Entity\Traits\TimestampableEntity;
  9. use AppBundle\Entity\Traits\CreatorUpdaterEntity;
  10. /**
  11. * Personnalisation d'une liste par un Access
  12. *
  13. * @Iri("http://schema.org/PersonalizedList")
  14. */
  15. #[ORM\Entity]
  16. class PersonalizedList
  17. {
  18. use TimestampableEntity;
  19. use CreatorUpdaterEntity;
  20. /**
  21. * @var int
  22. */
  23. #[ORM\Column(type: 'integer')]
  24. #[ORM\Id]
  25. #[ORM\GeneratedValue(strategy: 'AUTO')]
  26. #[Groups(['personalizedlist'])]
  27. private $id;
  28. /**
  29. * @var Access
  30. */
  31. #[ORM\ManyToOne(targetEntity: 'Access', inversedBy: 'personalizedLists')]
  32. #[ORM\JoinColumn(nullable: false)]
  33. #[Assert\NotNull]
  34. #[Groups(['personalizedlist'])]
  35. private $access;
  36. /**
  37. * @var $label
  38. */
  39. #[ORM\Column(type: 'string', length: 200, nullable: true)]
  40. #[Assert\Type(type: 'string')]
  41. #[Groups(['personalizedlist'])]
  42. private $label;
  43. /**
  44. * @var array
  45. */
  46. #[ORM\Column(type: 'json_array', nullable: true)]
  47. #[Groups(['personalizedlist'])]
  48. private $filters;
  49. #[ORM\Column(type: 'string', length: 150)]
  50. #[Assert\Type(type: 'string')]
  51. #[Groups(['personalizedlist'])]
  52. private $entity;
  53. /**
  54. * @var array
  55. */
  56. #[ORM\Column(type: 'json_array', nullable: true)]
  57. #[Groups(['personalizedlist'])]
  58. private $columns;
  59. /**
  60. * @var $menuKey
  61. */
  62. #[ORM\Column(type: 'string', length: 150, nullable: true)]
  63. #[Assert\Type(type: 'string')]
  64. #[Groups(['personalizedlist'])]
  65. private $menuKey;
  66. /**
  67. * Sets id.
  68. *
  69. * @param int $id
  70. *
  71. * @return $this
  72. */
  73. public function setId($id)
  74. {
  75. $this->id = $id;
  76. return $this;
  77. }
  78. /**
  79. * Gets id.
  80. *
  81. * @return int
  82. */
  83. public function getId()
  84. {
  85. return $this->id;
  86. }
  87. /**
  88. * Set filters
  89. *
  90. * @param array $filters
  91. *
  92. * @return PersonalizedList
  93. */
  94. public function setFilters($filters)
  95. {
  96. $this->filters = $filters;
  97. return $this;
  98. }
  99. /**
  100. * Get filters
  101. *
  102. * @return array
  103. */
  104. public function getFilters()
  105. {
  106. return $this->filters;
  107. }
  108. /**
  109. * Set columns
  110. *
  111. * @param array $columns
  112. *
  113. * @return PersonalizedList
  114. */
  115. public function setColumns($columns)
  116. {
  117. $this->columns = $columns;
  118. return $this;
  119. }
  120. /**
  121. * Get columns
  122. *
  123. * @return array
  124. */
  125. public function getColumns()
  126. {
  127. return $this->columns;
  128. }
  129. /**
  130. * Set access
  131. *
  132. * @param \AppBundle\Entity\AccessAndFunction\Access $access
  133. *
  134. * @return PersonalizedList
  135. */
  136. public function setAccess(\AppBundle\Entity\AccessAndFunction\Access $access)
  137. {
  138. $this->access = $access;
  139. return $this;
  140. }
  141. /**
  142. * Get access
  143. *
  144. * @return \AppBundle\Entity\AccessAndFunction\Access
  145. */
  146. public function getAccess()
  147. {
  148. return $this->access;
  149. }
  150. /**
  151. * Set menuKey
  152. *
  153. * @param string $menuKey
  154. *
  155. * @return PersonalizedList
  156. */
  157. public function setMenuKey($menuKey)
  158. {
  159. $this->menuKey = $menuKey;
  160. return $this;
  161. }
  162. /**
  163. * Get menuKey
  164. *
  165. * @return string
  166. */
  167. public function getMenuKey()
  168. {
  169. return $this->menuKey;
  170. }
  171. /**
  172. * Set label
  173. *
  174. * @param string $label
  175. *
  176. * @return PersonalizedList
  177. */
  178. public function setLabel($label)
  179. {
  180. $this->label = $label;
  181. return $this;
  182. }
  183. /**
  184. * Get label
  185. *
  186. * @return string
  187. */
  188. public function getLabel()
  189. {
  190. return $this->label;
  191. }
  192. /**
  193. * Set entity
  194. *
  195. * @param string $entity
  196. *
  197. * @return PersonalizedList
  198. */
  199. public function setEntity($entity)
  200. {
  201. $this->entity = $entity;
  202. return $this;
  203. }
  204. /**
  205. * Get entity
  206. *
  207. * @return string
  208. */
  209. public function getEntity()
  210. {
  211. return $this->entity;
  212. }
  213. }