src/Entity/Projet.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProjetRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8. * @ORM\Entity(repositoryClass=ProjetRepository::class)
  9. */
  10. class Projet
  11. {
  12. /**
  13. * @ORM\Id()
  14. * @ORM\GeneratedValue()
  15. * @ORM\Column(type="integer")
  16. */
  17. private $id;
  18. /**
  19. * @ORM\OneToMany(targetEntity=Apprenant::class, mappedBy="projet")
  20. */
  21. private $apprenants;
  22. /**
  23. * @ORM\OneToMany(targetEntity=Communication::class, mappedBy="projet")
  24. */
  25. private $communications;
  26. /**
  27. * @ORM\OneToMany(targetEntity=Compagne::class, mappedBy="projet")
  28. */
  29. private $compagnes;
  30. /**
  31. * @ORM\OneToMany(targetEntity=Evolution::class, mappedBy="projet")
  32. */
  33. private $evolutions;
  34. /**
  35. * @ORM\OneToMany(targetEntity=Inscription::class, mappedBy="projet")
  36. */
  37. private $inscriptions;
  38. /**
  39. * @ORM\Column(type="integer")
  40. */
  41. private $idProjet;
  42. /**
  43. * @ORM\Column(type="string", length=255, nullable=true)
  44. */
  45. private $code;
  46. /**
  47. * @ORM\Column(type="string", length=255, nullable=true)
  48. */
  49. private $nom;
  50. /**
  51. * @ORM\Column(type="date", nullable=true)
  52. */
  53. private $date_lancement;
  54. /**
  55. * @ORM\Column(type="date", nullable=true)
  56. */
  57. private $date_fin;
  58. /**
  59. * @ORM\Column(type="integer", nullable=true)
  60. */
  61. private $effectif_prevu;
  62. /**
  63. * @ORM\OneToOne(targetEntity=StatProjet::class, cascade={"persist", "remove"})
  64. * @ORM\JoinColumn(name="id_stat_projet")
  65. */
  66. private $statProjet;
  67. /**
  68. * @ORM\ManyToOne(targetEntity=Client::class, inversedBy="projets")
  69. * @ORM\JoinColumn(name="id_client", referencedColumnName="id", onDelete="CASCADE")
  70. */
  71. private $client;
  72. /**
  73. * @ORM\Column(type="string", length=255, nullable=true)
  74. */
  75. private $descriptif;
  76. /**
  77. * @ORM\Column(name="listePopulation",type="string", length=255, nullable=true)
  78. */
  79. private $listePopulation;
  80. /**
  81. * @ORM\ManyToOne(targetEntity=Utilisateur::class, inversedBy="projets")
  82. * @ORM\JoinColumn(name="idCP", referencedColumnName="id")
  83. */
  84. private $idCP;
  85. /**
  86. * @ORM\ManyToOne(targetEntity=Utilisateur::class, inversedBy="projets")
  87. * @ORM\JoinColumn(name="idChargeProjet", referencedColumnName="id")
  88. */
  89. private $idChargeProjet;
  90. /**
  91. * @ORM\OneToOne(targetEntity=CustomStatProjet::class, cascade={"persist", "remove"})
  92. * @ORM\JoinColumn(name="id_custom_stat")
  93. */
  94. private $customStatProjet;
  95. /**
  96. * @ORM\Column(type="integer", nullable=true)
  97. */
  98. private $actif;
  99. /**
  100. * @ORM\Column(name="dateActif",type="string", length=255, nullable=true)
  101. */
  102. private $dateActif;
  103. /**
  104. * @ORM\Column(name="dateMaj",type="string", length=255, nullable=true)
  105. */
  106. private $dateMaj;
  107. /**
  108. * @ORM\Column(type="integer", nullable=true)
  109. */
  110. private $groupe;
  111. /**
  112. * @ORM\Column(type="integer", nullable=true)
  113. */
  114. private $type;
  115. /**
  116. * @ORM\Column(name="majApprenants",type="integer", nullable=true)
  117. */
  118. private $majApprenants;
  119. /**
  120. * @ORM\ManyToMany(targetEntity=Cours::class, inversedBy="projets")
  121. * @ORM\JoinColumn(name="idCourse", referencedColumnName="id")
  122. */
  123. private $courses;
  124. /**
  125. * @ORM\ManyToMany(targetEntity=Formation::class, inversedBy="projets")
  126. */
  127. private $formations;
  128. /**
  129. * @ORM\ManyToMany(targetEntity=Utilisateur::class, inversedBy="coachProjects")
  130. * @ORM\JoinTable(name="projet_coach")
  131. */
  132. private $coaches;
  133. public function __construct()
  134. {
  135. $this->apprenants = new ArrayCollection();
  136. $this->communications = new ArrayCollection();
  137. $this->compagnes = new ArrayCollection();
  138. $this->evolutions = new ArrayCollection();
  139. $this->inscriptions = new ArrayCollection();
  140. $this->courses = new ArrayCollection();
  141. $this->formations = new ArrayCollection();
  142. $this->coaches = new ArrayCollection();
  143. }
  144. public function getId(): ?int
  145. {
  146. return $this->id;
  147. }
  148. /**
  149. * @return Collection|Apprenant[]
  150. */
  151. public function getApprenants(): Collection
  152. {
  153. return $this->apprenants;
  154. }
  155. public function addApprenant(Apprenant $apprenant): self
  156. {
  157. if (!$this->apprenants->contains($apprenant)) {
  158. $this->apprenants[] = $apprenant;
  159. $apprenant->setProjet($this);
  160. }
  161. return $this;
  162. }
  163. public function removeApprenant(Apprenant $apprenant): self
  164. {
  165. if ($this->apprenants->contains($apprenant)) {
  166. $this->apprenants->removeElement($apprenant);
  167. // set the owning side to null (unless already changed)
  168. if ($apprenant->getProjet() === $this) {
  169. $apprenant->setProjet(null);
  170. }
  171. }
  172. return $this;
  173. }
  174. /**
  175. * @return Collection|Communication[]
  176. */
  177. public function getCommunications(): Collection
  178. {
  179. return $this->communications;
  180. }
  181. public function addCommunication(Communication $communication): self
  182. {
  183. if (!$this->communications->contains($communication)) {
  184. $this->communications[] = $communication;
  185. $communication->setProjet($this);
  186. }
  187. return $this;
  188. }
  189. public function removeCommunication(Communication $communication): self
  190. {
  191. if ($this->communications->contains($communication)) {
  192. $this->communications->removeElement($communication);
  193. // set the owning side to null (unless already changed)
  194. if ($communication->getProjet() === $this) {
  195. $communication->setProjet(null);
  196. }
  197. }
  198. return $this;
  199. }
  200. /**
  201. * @return Collection|Compagne[]
  202. */
  203. public function getCompagnes(): Collection
  204. {
  205. return $this->compagnes;
  206. }
  207. public function addCompagne(Compagne $compagne): self
  208. {
  209. if (!$this->compagnes->contains($compagne)) {
  210. $this->compagnes[] = $compagne;
  211. $compagne->setProjet($this);
  212. }
  213. return $this;
  214. }
  215. public function removeCompagne(Compagne $compagne): self
  216. {
  217. if ($this->compagnes->contains($compagne)) {
  218. $this->compagnes->removeElement($compagne);
  219. // set the owning side to null (unless already changed)
  220. if ($compagne->getProjet() === $this) {
  221. $compagne->setProjet(null);
  222. }
  223. }
  224. return $this;
  225. }
  226. /**
  227. * @return Collection|Evolution[]
  228. */
  229. public function getEvolutions(): Collection
  230. {
  231. return $this->evolutions;
  232. }
  233. public function addEvolution(Evolution $evolution): self
  234. {
  235. if (!$this->evolutions->contains($evolution)) {
  236. $this->evolutions[] = $evolution;
  237. $evolution->setProjet($this);
  238. }
  239. return $this;
  240. }
  241. public function removeEvolution(Evolution $evolution): self
  242. {
  243. if ($this->evolutions->contains($evolution)) {
  244. $this->evolutions->removeElement($evolution);
  245. // set the owning side to null (unless already changed)
  246. if ($evolution->getProjet() === $this) {
  247. $evolution->setProjet(null);
  248. }
  249. }
  250. return $this;
  251. }
  252. /**
  253. * @return Collection|Inscription[]
  254. */
  255. public function getInscriptions(): Collection
  256. {
  257. return $this->inscriptions;
  258. }
  259. public function addInscription(Inscription $inscription): self
  260. {
  261. if (!$this->inscriptions->contains($inscription)) {
  262. $this->inscriptions[] = $inscription;
  263. $inscription->setProjet($this);
  264. }
  265. return $this;
  266. }
  267. public function removeInscription(Inscription $inscription): self
  268. {
  269. if ($this->inscriptions->contains($inscription)) {
  270. $this->inscriptions->removeElement($inscription);
  271. // set the owning side to null (unless already changed)
  272. if ($inscription->getProjet() === $this) {
  273. $inscription->setProjet(null);
  274. }
  275. }
  276. return $this;
  277. }
  278. public function getIdProjet(): ?int
  279. {
  280. return $this->idProjet;
  281. }
  282. public function setIdProjet(int $idProjet): self
  283. {
  284. $this->idProjet = $idProjet;
  285. return $this;
  286. }
  287. public function getCode(): ?string
  288. {
  289. return $this->code;
  290. }
  291. public function setCode(?string $code): self
  292. {
  293. $this->code = $code;
  294. return $this;
  295. }
  296. public function getNom(): ?string
  297. {
  298. return $this->nom;
  299. }
  300. public function setNom(?string $nom): self
  301. {
  302. $this->nom = $nom;
  303. return $this;
  304. }
  305. public function getDateLancement(): ?\DateTimeInterface
  306. {
  307. return $this->date_lancement;
  308. }
  309. public function setDateLancement(?\DateTimeInterface $date_lancement): self
  310. {
  311. $this->date_lancement = $date_lancement;
  312. return $this;
  313. }
  314. public function getDateFin(): ?\DateTimeInterface
  315. {
  316. return $this->date_fin;
  317. }
  318. public function setDateFin(?\DateTimeInterface $date_fin): self
  319. {
  320. $this->date_fin = $date_fin;
  321. return $this;
  322. }
  323. public function getEffectifPrevu(): ?int
  324. {
  325. return $this->effectif_prevu;
  326. }
  327. public function setEffectifPrevu(?int $effectif_prevu): self
  328. {
  329. $this->effectif_prevu = $effectif_prevu;
  330. return $this;
  331. }
  332. public function getStatProjet(): ?StatProjet
  333. {
  334. return $this->statProjet;
  335. }
  336. public function setStatProjet(?StatProjet $statProjet): self
  337. {
  338. $this->statProjet = $statProjet;
  339. return $this;
  340. }
  341. public function getClient(): ?Client
  342. {
  343. return $this->client;
  344. }
  345. public function setClient(?Client $client): self
  346. {
  347. $this->client = $client;
  348. return $this;
  349. }
  350. public function getDescriptif(): ?string
  351. {
  352. return $this->descriptif;
  353. }
  354. public function setDescriptif(?string $descriptif): self
  355. {
  356. $this->descriptif = $descriptif;
  357. return $this;
  358. }
  359. public function getListePopulation(): ?string
  360. {
  361. return $this->listePopulation;
  362. }
  363. public function setListePopulation(?string $listePopulation): self
  364. {
  365. $this->listePopulation = $listePopulation;
  366. return $this;
  367. }
  368. public function getIdCP(): ?Utilisateur
  369. {
  370. return $this->idCP;
  371. }
  372. public function setIdCP(?Utilisateur $idCP): self
  373. {
  374. $this->idCP = $idCP;
  375. return $this;
  376. }
  377. public function getIdChargeProjet(): ?Utilisateur
  378. {
  379. return $this->idChargeProjet;
  380. }
  381. public function setIdChargeProjet(?Utilisateur $idChargeProjet): self
  382. {
  383. $this->idChargeProjet = $idChargeProjet;
  384. return $this;
  385. }
  386. public function getCustomStatProjet(): ?CustomStatProjet
  387. {
  388. return $this->customStatProjet;
  389. }
  390. public function setCustomStatProjet(?CustomStatProjet $customStatProjet): self
  391. {
  392. $this->customStatProjet = $customStatProjet;
  393. return $this;
  394. }
  395. public function getActif(): ?int
  396. {
  397. return $this->actif;
  398. }
  399. public function setActif(?int $actif): self
  400. {
  401. $this->actif = $actif;
  402. return $this;
  403. }
  404. public function getDateActif(): ?string
  405. {
  406. return $this->dateActif;
  407. }
  408. public function setDateActif(?string $dateActif): self
  409. {
  410. $this->dateActif = $dateActif;
  411. return $this;
  412. }
  413. public function getDateMaj(): ?string
  414. {
  415. return $this->dateMaj;
  416. }
  417. public function setDateMaj(?string $dateMaj): self
  418. {
  419. $this->dateMaj = $dateMaj;
  420. return $this;
  421. }
  422. public function getGroupe(): ?int
  423. {
  424. return $this->groupe;
  425. }
  426. public function setGroupe(?int $groupe): self
  427. {
  428. $this->groupe = $groupe;
  429. return $this;
  430. }
  431. public function getType(): ?int
  432. {
  433. return $this->type;
  434. }
  435. public function setType(?int $type): self
  436. {
  437. $this->type = $type;
  438. return $this;
  439. }
  440. public function getMajApprenants(): ?int
  441. {
  442. return $this->majApprenants;
  443. }
  444. public function setMajApprenants(?int $majApprenants): self
  445. {
  446. $this->majApprenants = $majApprenants;
  447. return $this;
  448. }
  449. /**
  450. * @return Collection|Cours[]
  451. */
  452. public function getCourses(): Collection
  453. {
  454. return $this->courses;
  455. }
  456. public function addCourse(Cours $course): self
  457. {
  458. if (!$this->courses->contains($course)) {
  459. $this->courses[] = $course;
  460. }
  461. return $this;
  462. }
  463. public function removeCourse(Cours $course): self
  464. {
  465. if ($this->courses->contains($course)) {
  466. $this->courses->removeElement($course);
  467. }
  468. return $this;
  469. }
  470. /**
  471. * @return Collection|Formation[]
  472. */
  473. public function getFormations(): Collection
  474. {
  475. return $this->formations;
  476. }
  477. public function addFormation(Formation $formation): self
  478. {
  479. if (!$this->formations->contains($formation)) {
  480. $this->formations[] = $formation;
  481. }
  482. return $this;
  483. }
  484. public function removeFormation(Formation $formation): self
  485. {
  486. $this->formations->removeElement($formation);
  487. return $this;
  488. }
  489. /**
  490. * @return Collection|Utilisateur[]
  491. */
  492. public function getCoaches(): Collection
  493. {
  494. return $this->coaches;
  495. }
  496. public function addCoach(Utilisateur $coache): self
  497. {
  498. if (!$this->coaches->contains($coache)) {
  499. $this->coaches[] = $coache;
  500. }
  501. return $this;
  502. }
  503. public function removeCoach(Utilisateur $coache): self
  504. {
  505. $this->coaches->removeElement($coache);
  506. return $this;
  507. }
  508. }