LicenceCmf.php 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. <?php
  2. declare(strict_types=1);
  3. namespace App\Service\Export\Model;
  4. use App\Entity\Core\File;
  5. /**
  6. * Modèle de données d'une licence CMF (d'organisation ou personnelle)
  7. */
  8. class LicenceCmf implements ExportModelInterface
  9. {
  10. /**
  11. * An id for the licence
  12. * @var int
  13. */
  14. private int $id;
  15. /**
  16. * Year of the licence
  17. * @var int
  18. */
  19. private int $year;
  20. /**
  21. * Is this the licence of an organization and not of a person?
  22. * @var bool
  23. */
  24. private bool $isOrganizationLicence;
  25. /**
  26. * Name of the organization
  27. * @var string
  28. */
  29. private string $organizationName;
  30. /**
  31. * Identifier of the organization
  32. * @var string
  33. */
  34. private string $organizationIdentifier;
  35. /**
  36. * Name of the federation
  37. * @var string|null
  38. */
  39. private string $federationName;
  40. /**
  41. * Color of the licence card for the given year
  42. * @var string
  43. */
  44. private string $color;
  45. /**
  46. * Organization's logo or Person's avatar
  47. * @var File|null
  48. */
  49. private ?File $logo = null;
  50. /**
  51. * CMF QrCode
  52. * @var File|null
  53. */
  54. private ?File $qrCode = null;
  55. /**
  56. * Gender of the licence owner
  57. * @var int|null
  58. */
  59. private ?int $personId = null;
  60. /**
  61. * Gender of the licence owner
  62. * @var string
  63. */
  64. private string $personGender = '';
  65. /**
  66. * First name of the licence owner
  67. * @var string
  68. */
  69. private string $personFirstName = '';
  70. /**
  71. * Name of the licence owner
  72. * @var string
  73. */
  74. private string $personLastName = '';
  75. /**
  76. * Avatar of the user (personal licence only)
  77. *
  78. * @var File|null
  79. */
  80. private ?File $personAvatar = null;
  81. /**
  82. * @return int
  83. */
  84. public function getId(): int
  85. {
  86. return $this->id;
  87. }
  88. /**
  89. * @param int $id
  90. * @return LicenceCmf
  91. */
  92. public function setId(int $id): self
  93. {
  94. $this->id = $id;
  95. return $this;
  96. }
  97. /**
  98. * @return int
  99. */
  100. public function getYear(): int
  101. {
  102. return $this->year;
  103. }
  104. /**
  105. * @param int $year
  106. * @return LicenceCmf
  107. */
  108. public function setYear(int $year): self
  109. {
  110. $this->year = $year;
  111. return $this;
  112. }
  113. /**
  114. * @return bool
  115. */
  116. public function isOrganizationLicence(): bool
  117. {
  118. return $this->isOrganizationLicence;
  119. }
  120. /**
  121. * @param bool $isOrganizationLicence
  122. * @return LicenceCmf
  123. */
  124. public function setIsOrganizationLicence(bool $isOrganizationLicence): self
  125. {
  126. $this->isOrganizationLicence = $isOrganizationLicence;
  127. return $this;
  128. }
  129. /**
  130. * @return string
  131. */
  132. public function getOrganizationName(): string
  133. {
  134. return $this->organizationName;
  135. }
  136. /**
  137. * @param string $organizationName
  138. * @return LicenceCmf
  139. */
  140. public function setOrganizationName(string $organizationName): self
  141. {
  142. $this->organizationName = $organizationName;
  143. return $this;
  144. }
  145. /**
  146. * @return string
  147. */
  148. public function getOrganizationIdentifier(): string
  149. {
  150. return $this->organizationIdentifier;
  151. }
  152. /**
  153. * @param string|null $organizationIdentifier
  154. * @return LicenceCmf
  155. */
  156. public function setOrganizationIdentifier(?string $organizationIdentifier): self
  157. {
  158. $this->organizationIdentifier = $organizationIdentifier;
  159. return $this;
  160. }
  161. /**
  162. * @return string|null
  163. */
  164. public function getFederationName(): ?string
  165. {
  166. return $this->federationName;
  167. }
  168. /**
  169. * @param string $federationName
  170. * @return LicenceCmf
  171. */
  172. public function setFederationName(string $federationName): self
  173. {
  174. $this->federationName = $federationName;
  175. return $this;
  176. }
  177. /**
  178. * @return string
  179. */
  180. public function getColor(): string
  181. {
  182. return $this->color;
  183. }
  184. /**
  185. * @param string $color
  186. * @return LicenceCmf
  187. */
  188. public function setColor(string $color): self
  189. {
  190. $this->color = $color;
  191. return $this;
  192. }
  193. /**
  194. * @return File|null
  195. */
  196. public function getLogo(): ?File
  197. {
  198. return $this->logo;
  199. }
  200. /**
  201. * @param File|null $logo
  202. * @return LicenceCmf
  203. */
  204. public function setLogo(?File $logo): LicenceCmf
  205. {
  206. $this->logo = $logo;
  207. return $this;
  208. }
  209. /**
  210. * @return File|null
  211. */
  212. public function getQrCode(): ?File
  213. {
  214. return $this->qrCode;
  215. }
  216. /**
  217. * @param File|null $qrCode
  218. * @return LicenceCmf
  219. */
  220. public function setQrCode(?File $qrCode): LicenceCmf
  221. {
  222. $this->qrCode = $qrCode;
  223. return $this;
  224. }
  225. /**
  226. * @return int
  227. */
  228. public function getPersonId(): int
  229. {
  230. return $this->personId;
  231. }
  232. /**
  233. * @param int|null $personId
  234. * @return LicenceCmf
  235. */
  236. public function setPersonId(?int $personId): self
  237. {
  238. $this->personId = $personId;
  239. return $this;
  240. }
  241. /**
  242. * @return string
  243. */
  244. public function getPersonGender(): string
  245. {
  246. return $this->personGender;
  247. }
  248. /**
  249. * @param string $personGender
  250. * @return LicenceCmf
  251. */
  252. public function setPersonGender(string $personGender): self
  253. {
  254. $this->personGender = $personGender;
  255. return $this;
  256. }
  257. /**
  258. * @return string
  259. */
  260. public function getPersonFirstName(): string
  261. {
  262. return $this->personFirstName;
  263. }
  264. /**
  265. * @param string $personFirstName
  266. * @return LicenceCmf
  267. */
  268. public function setPersonFirstName(string $personFirstName): self
  269. {
  270. $this->personFirstName = $personFirstName;
  271. return $this;
  272. }
  273. /**
  274. * @return string
  275. */
  276. public function getPersonLastName(): string
  277. {
  278. return $this->personLastName;
  279. }
  280. /**
  281. * @param string $personLastName
  282. * @return LicenceCmf
  283. */
  284. public function setPersonLastName(string $personLastName): self
  285. {
  286. $this->personLastName = $personLastName;
  287. return $this;
  288. }
  289. /**
  290. * @return File|null
  291. */
  292. public function getPersonAvatar(): ?File
  293. {
  294. return $this->personAvatar;
  295. }
  296. /**
  297. * @param File|null $personAvatar
  298. * @return LicenceCmf
  299. */
  300. public function setPersonAvatar(?File $personAvatar): LicenceCmf
  301. {
  302. $this->personAvatar = $personAvatar;
  303. return $this;
  304. }
  305. }