src/Entity/Evenement.php line 12

  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EvenementRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\DBAL\Types\Types;
  7. use Doctrine\ORM\Mapping as ORM;
  8. #[ORM\Entity(repositoryClassEvenementRepository::class)]
  9. class Evenement
  10. {
  11.     const STATUS_DRAFT 1;
  12.     const STATUS_VALIDATED 2;
  13.     const STATUS_DISABLED 3;
  14.     const STATUS_ARCHIVED 4;
  15.     const COMMUNICATION_ORALE 1;
  16.     const COMMUNICATION_ECRITE 2;
  17.     const POSTER 3;
  18.     #[ORM\Id]
  19.     #[ORM\GeneratedValue]
  20.     #[ORM\Column]
  21.     private ?int $id null;
  22.     #[ORM\Column(length255)]
  23.     private ?string $title null;
  24.     #[ORM\Column(length255nullabletrue)]
  25.     private ?string $titleFormatted null;
  26.     #[ORM\Column(length255nullabletrue)]
  27.     private ?string $subTitle null;
  28.     #[ORM\Column(typeTypes::SMALLINT)]
  29.     private ?int $status null;
  30.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  31.     private ?\DateTimeInterface $startDate null;
  32.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  33.     private ?\DateTimeInterface $endDate null;
  34.     #[ORM\ManyToOne(targetEntityself::class, inversedBy'subEvenements')]
  35.     #[ORM\JoinColumn(nullabletrue)]
  36.     private ?self $parent null;
  37.     #[ORM\OneToMany(mappedBy'parent'targetEntityself::class)]
  38.     private Collection $subEvenements;
  39.     #[ORM\Column(typeTypes::JSONnullabletrue)]
  40.     private ?array $settings = [];
  41.     #[ORM\OneToMany(mappedBy'evenement'targetEntityLine::class)]
  42.     private Collection $lineList;
  43.     #[ORM\Column(type'datetime')]
  44.     private $createdAt;
  45.     #[ORM\Column(type'datetime'nullabletrue)]
  46.     private $updatedAt;
  47.     #[ORM\OneToMany(mappedBy'evenement'targetEntityInscription::class)]
  48.     private Collection $inscriptions;
  49.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  50.     private ?string $description null;
  51.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  52.     private ?\DateTimeInterface $dateOfPublication null;
  53.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  54.     private ?\DateTimeInterface $dateEndOfPublication null;
  55.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  56.     private ?\DateTimeInterface $dateDebutSoumission null;
  57.     #[ORM\Column(typeTypes::DATETIME_MUTABLEnullabletrue)]
  58.     private ?\DateTimeInterface $dateFinSoumission null;
  59.     #[ORM\Column]
  60.     private ?bool $inscription false;
  61.     #[ORM\Column]
  62.     private ?bool $soumissionAbstract false;
  63.     #[ORM\Column(typeTypes::BOOLEANnullabletrueoptions: ['default' => false])]
  64.     private ?bool $soumissionAbstractMultiThemes false;
  65.     #[ORM\Column(length255nullabletrue)]
  66.     private ?string $couverture null;
  67.     #[ORM\Column(length50)]
  68.     private ?string $lieu null;
  69.     #[ORM\Column(length255nullabletrue)]
  70.     private ?string $seoAlias null;
  71.     #[ORM\Column(length255nullabletrue)]
  72.     private ?string $seoTitle null;
  73.     #[ORM\Column(length1000nullabletrue)]
  74.     private ?string $seoKeywords null;
  75.     #[ORM\Column(typeTypes::TEXTnullabletrue)]
  76.     private ?string $seoDescription null;
  77.     #[ORM\Column(length255)]
  78.     private ?string $reference null;
  79.     #[ORM\Column(name"programme_url"nullabletrue)]
  80.     private ?string $programmeUrl null;
  81.     #[ORM\Column(name"payment_success_text"nullabletrue)]
  82.     private ?string $paymentSuccessText null;
  83.     #[ORM\Column(name"payment_failure_text"nullabletrue)]
  84.     private ?string $paymentFailureText null;
  85.     #[ORM\Column(nullabletrue)]
  86.     private ?int $estCongres null;
  87.     #[ORM\Column(nullabletrue)]
  88.     private ?int $estArchive null;
  89.     #[ORM\Column(nullabletrueoptions: [])] // 'default' => "[]"
  90.     private ?array $compteurs = [];
  91.     #[ORM\OneToMany(mappedBy'eventId'targetEntityEventAbstract::class)]
  92.     private Collection $eventAbstracts;
  93.     #[ORM\OneToMany(mappedBy'event'targetEntityParticipant::class)]
  94.     private Collection $participants;
  95.     #[ORM\Column(typeTypes::BOOLEANnullabletrueoptions: ['default' => false])]
  96.     private bool $isMembership false;
  97.     #[ORM\Column(typeTypes::INTEGERnullabletrue)]
  98.     private ?int $membershipYear null;
  99.     #[ORM\Column(nullabletrueoptions: [])] // 'default' => "[]"
  100.     private ?array $paymentMethodes = [];
  101.     public function __construct()
  102.     {
  103.         $this->subEvenements = new ArrayCollection();
  104.         $this->lineList = new ArrayCollection();
  105.         $this->inscriptions = new ArrayCollection();
  106.         $this->eventAbstracts = new ArrayCollection();
  107.         $this->compteurs = [
  108.             "1" => 0,
  109.             "2" => 0,
  110.             "3" => 0,
  111.             "4" => 0,
  112.         ];
  113.         $this->paymentMethodes = [];
  114.         $this->participants = new ArrayCollection();
  115.     }
  116.     public function getId(): ?int
  117.     {
  118.         return $this->id;
  119.     }
  120.     public function getTitle(): ?string
  121.     {
  122.         return $this->title;
  123.     }
  124.     public function getTitleForAttestation()
  125.     {
  126.         return $this->title str_ireplace(["Inscription aux ateliers - ""Inscription au "], ""$this->title) : null;
  127.     }
  128.     public function setTitle(string $title): self
  129.     {
  130.         $this->title $title;
  131.         return $this;
  132.     }
  133.     public function getStatus(): ?int
  134.     {
  135.         return $this->status;
  136.     }
  137.     public function setStatus(int $status): self
  138.     {
  139.         $this->status $status;
  140.         return $this;
  141.     }
  142.     public function getStartDate(): ?\DateTimeInterface
  143.     {
  144.         return $this->startDate;
  145.     }
  146.     public function setStartDate(\DateTimeInterface $startDate): self
  147.     {
  148.         $this->startDate $startDate;
  149.         return $this;
  150.     }
  151.     public function getEndDate(): ?\DateTimeInterface
  152.     {
  153.         return $this->endDate;
  154.     }
  155.     public function setEndDate(\DateTimeInterface $endDate): self
  156.     {
  157.         $this->endDate $endDate;
  158.         return $this;
  159.     }
  160.     /**
  161.      * @return Collection<int, Line>
  162.      */
  163.     public function getLineList(): Collection
  164.     {
  165.         return $this->lineList;
  166.     }
  167.     public function addLineList(Line $lineList): self
  168.     {
  169.         if (!$this->lineList->contains($lineList)) {
  170.             $this->lineList->add($lineList);
  171.             $lineList->setEvenement($this);
  172.         }
  173.         return $this;
  174.     }
  175.     public function removeLineList(Line $lineList): self
  176.     {
  177.         if ($this->lineList->removeElement($lineList)) {
  178.             // set the owning side to null (unless already changed)
  179.             if ($lineList->getEvenement() === $this) {
  180.                 $lineList->setEvenement(null);
  181.             }
  182.         }
  183.         return $this;
  184.     }
  185.     public function getCreatedAt(): ?\DateTimeInterface
  186.     {
  187.         return $this->createdAt;
  188.     }
  189.     public function setCreatedAt(\DateTimeInterface $createdAt): self
  190.     {
  191.         $this->createdAt $createdAt;
  192.         return $this;
  193.     }
  194.     public function getUpdatedAt(): ?\DateTimeInterface
  195.     {
  196.         return $this->updatedAt;
  197.     }
  198.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  199.     {
  200.         $this->updatedAt $updatedAt;
  201.         return $this;
  202.     }
  203.     /**
  204.      * @return Collection<int, Inscription>
  205.      */
  206.     public function getInscriptions(): Collection
  207.     {
  208.         return $this->inscriptions;
  209.     }
  210.     public function addInscription(Inscription $inscription): self
  211.     {
  212.         if (!$this->inscriptions->contains($inscription)) {
  213.             $this->inscriptions->add($inscription);
  214.             $inscription->setEvenement($this);
  215.         }
  216.         return $this;
  217.     }
  218.     public function removeInscription(Inscription $inscription): self
  219.     {
  220.         if ($this->inscriptions->removeElement($inscription)) {
  221.             // set the owning side to null (unless already changed)
  222.             if ($inscription->getEvenement() === $this) {
  223.                 $inscription->setEvenement(null);
  224.             }
  225.         }
  226.         return $this;
  227.     }
  228.     public function getDescription(): ?string
  229.     {
  230.         return $this->description;
  231.     }
  232.     public function setDescription(?string $description): self
  233.     {
  234.         $this->description $description;
  235.         return $this;
  236.     }
  237.     public function getDateOfPublication(): ?\DateTimeInterface
  238.     {
  239.         return $this->dateOfPublication;
  240.     }
  241.     public function setDateOfPublication(\DateTimeInterface $dateOfPublication): self
  242.     {
  243.         $this->dateOfPublication $dateOfPublication;
  244.         return $this;
  245.     }
  246.     public function getDateEndOfPublication(): ?\DateTimeInterface
  247.     {
  248.         return $this->dateEndOfPublication;
  249.     }
  250.     public function setDateEndOfPublication(\DateTimeInterface $dateEndOfPublication): self
  251.     {
  252.         $this->dateEndOfPublication $dateEndOfPublication;
  253.         return $this;
  254.     }
  255.     public function isInscription(): ?bool
  256.     {
  257.         return $this->inscription;
  258.     }
  259.     public function setInscription(bool $inscription): self
  260.     {
  261.         $this->inscription $inscription;
  262.         return $this;
  263.     }
  264.     public function isSoumissionAbstract(): ?bool
  265.     {
  266.         return $this->soumissionAbstract;
  267.     }
  268.     public function setSoumissionAbstract(bool $soumissionAbstract): self
  269.     {
  270.         $this->soumissionAbstract $soumissionAbstract;
  271.         return $this;
  272.     }
  273.     public function getCouverture(): ?string
  274.     {
  275.         return $this->couverture;
  276.     }
  277.     public function setCouverture(?string $couverture): self
  278.     {
  279.         $this->couverture $couverture;
  280.         return $this;
  281.     }
  282.     public function getLieu(): ?string
  283.     {
  284.         return $this->lieu;
  285.     }
  286.     public function setLieu(string $lieu): self
  287.     {
  288.         $this->lieu $lieu;
  289.         return $this;
  290.     }
  291.     public function getSeoAlias(): ?string
  292.     {
  293.         return $this->seoAlias;
  294.     }
  295.     public function setSeoAlias(?string $seoAlias): self
  296.     {
  297.         $this->seoAlias $seoAlias;
  298.         return $this;
  299.     }
  300.     public function getSeoTitle(): ?string
  301.     {
  302.         return $this->seoTitle;
  303.     }
  304.     public function setSeoTitle(?string $seoTitle): self
  305.     {
  306.         $this->seoTitle $seoTitle;
  307.         return $this;
  308.     }
  309.     public function getSeoKeywords(): ?string
  310.     {
  311.         return $this->seoKeywords;
  312.     }
  313.     public function setSeoKeywords(?string $seoKeywords): self
  314.     {
  315.         $this->seoKeywords $seoKeywords;
  316.         return $this;
  317.     }
  318.     public function getSeoDescription(): ?string
  319.     {
  320.         return $this->seoDescription;
  321.     }
  322.     public function setSeoDescription(?string $seoDescription): self
  323.     {
  324.         $this->seoDescription $seoDescription;
  325.         return $this;
  326.     }
  327.     public function getReference(): ?string
  328.     {
  329.         return $this->reference;
  330.     }
  331.     public function setReference(string $reference): self
  332.     {
  333.         $this->reference $reference;
  334.         return $this;
  335.     }
  336.     /**
  337.      * Get the value of titleFormatted
  338.      */
  339.     public function getTitleFormatted()
  340.     {
  341.         if ($this->titleFormatted) {
  342.             return $this->titleFormatted;
  343.         }
  344.         return $this->getTitle();
  345.     }
  346.     /**
  347.      * Set the value of titleFormatted
  348.      *
  349.      * @return  self
  350.      */
  351.     public function setTitleFormatted($titleFormatted)
  352.     {
  353.         $this->titleFormatted $titleFormatted;
  354.         return $this;
  355.     }
  356.     /**
  357.      * Get the value of programmeUrl
  358.      */
  359.     public function getProgrammeUrl()
  360.     {
  361.         return $this->programmeUrl;
  362.     }
  363.     /**
  364.      * Set the value of programmeUrl
  365.      *
  366.      * @return  self
  367.      */
  368.     public function setProgrammeUrl($programmeUrl)
  369.     {
  370.         $this->programmeUrl $programmeUrl;
  371.         return $this;
  372.     }
  373.     /**
  374.      * Get the value of paymentSuccessText
  375.      */
  376.     public function getPaymentSuccessText()
  377.     {
  378.         return $this->paymentSuccessText;
  379.     }
  380.     /**
  381.      * Set the value of paymentSuccessText
  382.      *
  383.      * @return  self
  384.      */
  385.     public function setPaymentSuccessText($paymentSuccessText)
  386.     {
  387.         $this->paymentSuccessText $paymentSuccessText;
  388.         return $this;
  389.     }
  390.     /**
  391.      * Get the value of paymentFailureText
  392.      */
  393.     public function getPaymentFailureText()
  394.     {
  395.         return $this->paymentFailureText;
  396.     }
  397.     /**
  398.      * Set the value of paymentFailureText
  399.      *
  400.      * @return  self
  401.      */
  402.     public function setPaymentFailureText($paymentFailureText)
  403.     {
  404.         $this->paymentFailureText $paymentFailureText;
  405.         return $this;
  406.     }
  407.     public function getEstCongres(): ?int
  408.     {
  409.         return $this->estCongres;
  410.     }
  411.     public function setEstCongres(?int $estCongres): static
  412.     {
  413.         $this->estCongres $estCongres;
  414.         return $this;
  415.     }
  416.     public function getEstArchive(): ?int
  417.     {
  418.         return $this->estArchive;
  419.     }
  420.     public function setEstArchive(?int $estArchive): static
  421.     {
  422.         $this->estArchive $estArchive;
  423.         return $this;
  424.     }
  425.     public function getCompteurs(): ?array
  426.     {
  427.         if (is_null($this->compteurs)) {
  428.             $this->compteurs = [];
  429.         }
  430.         return $this->compteurs;
  431.     }
  432.     public function setCompteurs(?array $compteurs): static
  433.     {
  434.         $this->compteurs $compteurs;
  435.         return $this;
  436.     }
  437.     /**
  438.      * @return Collection<int, EventAbstract>
  439.      */
  440.     public function getEventAbstracts(): Collection
  441.     {
  442.         return $this->eventAbstracts;
  443.     }
  444.     public function addEventAbstract(EventAbstract $eventAbstract): static
  445.     {
  446.         if (!$this->eventAbstracts->contains($eventAbstract)) {
  447.             $this->eventAbstracts->add($eventAbstract);
  448.             $eventAbstract->setEvenement($this);
  449.         }
  450.         return $this;
  451.     }
  452.     public function removeEventAbstract(EventAbstract $eventAbstract): static
  453.     {
  454.         if ($this->eventAbstracts->removeElement($eventAbstract)) {
  455.             // set the owning side to null (unless already changed)
  456.             if ($eventAbstract->getEvenement() === $this) {
  457.                 $eventAbstract->setEvenement(null);
  458.             }
  459.         }
  460.         return $this;
  461.     }
  462.     /**
  463.      * Cette fonction sert à mettre à jour les compteurs des types d'abstracts
  464.      *
  465.      * @param int $type type d'abstract dont on va mettre à jour le compteur
  466.      * @param int $newOcc nouvelle valeur du compteur
  467.      * @return void
  468.      */
  469.     public function modifyCompteurs($type$newOcc)
  470.     {
  471.         if ($type && !is_null($newOcc)) {
  472.             $str strval($type);
  473.             $this->compteurs[$str] = $newOcc;
  474.         }
  475.     }
  476.     /**
  477.      * @return Collection<int, Participant>
  478.      */
  479.     public function getParticipants(): Collection
  480.     {
  481.         return $this->participants;
  482.     }
  483.     public function addParticipant(Participant $participant): static
  484.     {
  485.         if (!$this->participants->contains($participant)) {
  486.             $this->participants->add($participant);
  487.             $participant->setEvent($this);
  488.         }
  489.         return $this;
  490.     }
  491.     public function removeParticipant(Participant $participant): static
  492.     {
  493.         if ($this->participants->removeElement($participant)) {
  494.             // set the owning side to null (unless already changed)
  495.             if ($participant->getEvent() === $this) {
  496.                 $participant->setEvent(null);
  497.             }
  498.         }
  499.         return $this;
  500.     }
  501.     public function getDateDebutSoumission(): ?\DateTimeInterface
  502.     {
  503.         return $this->dateDebutSoumission;
  504.     }
  505.     public function setDateDebutSoumission(?\DateTimeInterface $dateDebutSoumission): static
  506.     {
  507.         $this->dateDebutSoumission $dateDebutSoumission;
  508.         return $this;
  509.     }
  510.     public function getDateFinSoumission(): ?\DateTimeInterface
  511.     {
  512.         return $this->dateFinSoumission;
  513.     }
  514.     public function setDateFinSoumission(?\DateTimeInterface $dateFinSoumission): static
  515.     {
  516.         $this->dateFinSoumission $dateFinSoumission;
  517.         return $this;
  518.     }
  519.     public function isMembership()
  520.     {
  521.         return $this->isMembership;
  522.     }
  523.     public function getIsMembership()
  524.     {
  525.         return $this->isMembership();
  526.     }
  527.     public function setIsMembership($isMembership)
  528.     {
  529.         $this->isMembership $isMembership;
  530.         return $this;
  531.     }
  532.     public function getMembershipYear()
  533.     {
  534.         return $this->membershipYear;
  535.     }
  536.     public function setMembershipYear($membershipYear)
  537.     {
  538.         $this->membershipYear $membershipYear;
  539.         return $this;
  540.     }
  541.     public function getPaymentMethodes(): ?array
  542.     {
  543.         if (is_null($this->paymentMethodes)) {
  544.             $this->paymentMethodes = [];
  545.         }
  546.         return $this->paymentMethodes;
  547.     }
  548.     public function setPaymentMethodes(?array $paymentMethodes): self
  549.     {
  550.         $this->paymentMethodes $paymentMethodes;
  551.         return $this;
  552.     }
  553.     public function isSoumissionAbstractMultiThemes(): ?bool
  554.     {
  555.         return $this->soumissionAbstractMultiThemes;
  556.     }
  557.     public function setSoumissionAbstractMultiThemes(?bool $soumissionAbstractMultiThemes): self
  558.     {
  559.         $this->soumissionAbstractMultiThemes $soumissionAbstractMultiThemes;
  560.         return $this;
  561.     }
  562.     public function getSubTitle()
  563.     {
  564.         return $this->subTitle;
  565.     }
  566.     public function setSubTitle($subTitle): self
  567.     {
  568.         $this->subTitle $subTitle;
  569.         return $this;
  570.     }
  571.     public function getParent(): ?self
  572.     {
  573.         return $this->parent;
  574.     }
  575.     public function setParent(?self $parent): self
  576.     {
  577.         $this->parent $parent;
  578.         return $this;
  579.     }
  580.     public function getSubEvenements(): Collection
  581.     {
  582.         return $this->subEvenements;
  583.     }
  584.     public function addSubEvenement(self $subEvenement): self
  585.     {
  586.         if (!$this->subEvenements->contains($subEvenement)) {
  587.             $this->subEvenements->add($subEvenement);
  588.             $subEvenement->setParent($this);
  589.         }
  590.         return $this;
  591.     }
  592.     public function removeSubEvenement(self $subEvenement): self
  593.     {
  594.         if ($this->subEvenements->removeElement($subEvenement)) {
  595.             // set the owning side to null (unless already changed)
  596.             if ($subEvenement->getParent() === $this) {
  597.                 $subEvenement->setParent(null);
  598.             }
  599.         }
  600.         return $this;
  601.     }
  602.     /*
  603.     public function setSubEvenements($subEvenements)
  604.     {
  605.         $this->subEvenements = $subEvenements;
  606.         return $this;
  607.     }
  608.     */
  609.     public function getChild(): ?self
  610.     {
  611.         $children $this->subEvenements $this->subEvenements->filter(function(?Evenement $evenement null) {
  612.             return $evenement && $evenement->getStatus() == Evenement::STATUS_VALIDATED;
  613.         }) : null;
  614.         return $children && $children->first() ? $children->first() : null;
  615.     }
  616.     public function getSettings(): array
  617.     {
  618.         if (is_null($this->settings)) {
  619.             $this->settings = [];
  620.         }
  621.         return $this->settings;
  622.     }
  623.     public function setSettings($settings): self
  624.     {
  625.         $this->settings $settings;
  626.         return $this;
  627.     }
  628. }