src/Entity/Calendrier.php line 12

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CalendrierRepository;
  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(repositoryClassCalendrierRepository::class)]
  9. class Calendrier
  10. {
  11.     #[ORM\Id]
  12.     #[ORM\GeneratedValue]
  13.     #[ORM\Column]
  14.     private ?int $id null;
  15.     #[ORM\Column(length255)]
  16.     private ?string $titre null;
  17.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  18.     private ?\DateTimeInterface $start null;
  19.     #[ORM\Column(typeTypes::DATETIME_MUTABLE)]
  20.     private ?\DateTimeInterface $end null;
  21.     #[ORM\Column(typeTypes::TEXT)]
  22.     private ?string $description null;
  23.     #[ORM\Column]
  24.     private ?bool $all_day null;
  25.     #[ORM\Column(length7)]
  26.     private ?string $background_color null;
  27.     #[ORM\Column(length7)]
  28.     private ?string $border_color null;
  29.     #[ORM\Column(length7)]
  30.     private ?string $text_color null;
  31.     #[ORM\OneToMany(mappedBy'calendrier'targetEntityJobCard::class)]
  32.     private Collection $jobCards;
  33.     public function __construct()
  34.     {
  35.         $this->jobCards = new ArrayCollection();
  36.     }
  37.     public function getId(): ?int
  38.     {
  39.         return $this->id;
  40.     }
  41.     public function getTitre(): ?string
  42.     {
  43.         return $this->titre;
  44.     }
  45.     public function setTitre(string $titre): static
  46.     {
  47.         $this->titre $titre;
  48.         return $this;
  49.     }
  50.     public function getStart(): ?\DateTimeInterface
  51.     {
  52.         return $this->start;
  53.     }
  54.     public function setStart(\DateTimeInterface $start): static
  55.     {
  56.         $this->start $start;
  57.         return $this;
  58.     }
  59.     public function getEnd(): ?\DateTimeInterface
  60.     {
  61.         return $this->end;
  62.     }
  63.     public function setEnd(\DateTimeInterface $end): static
  64.     {
  65.         $this->end $end;
  66.         return $this;
  67.     }
  68.     public function getDescription(): ?string
  69.     {
  70.         return $this->description;
  71.     }
  72.     public function setDescription(string $description): static
  73.     {
  74.         $this->description $description;
  75.         return $this;
  76.     }
  77.     public function isAllDay(): ?bool
  78.     {
  79.         return $this->all_day;
  80.     }
  81.     public function setAllDay(bool $all_day): static
  82.     {
  83.         $this->all_day $all_day;
  84.         return $this;
  85.     }
  86.     public function getBackgroundColor(): ?string
  87.     {
  88.         return $this->background_color;
  89.     }
  90.     public function setBackgroundColor(string $background_color): static
  91.     {
  92.         $this->background_color $background_color;
  93.         return $this;
  94.     }
  95.     public function getBorderColor(): ?string
  96.     {
  97.         return $this->border_color;
  98.     }
  99.     public function setBorderColor(string $border_color): static
  100.     {
  101.         $this->border_color $border_color;
  102.         return $this;
  103.     }
  104.     public function getTextColor(): ?string
  105.     {
  106.         return $this->text_color;
  107.     }
  108.     public function setTextColor(string $text_color): static
  109.     {
  110.         $this->text_color $text_color;
  111.         return $this;
  112.     }
  113.     /**
  114.      * @return Collection<int, JobCard>
  115.      */
  116.     public function getJobCards(): Collection
  117.     {
  118.         return $this->jobCards;
  119.     }
  120.     public function addJobCard(JobCard $jobCard): static
  121.     {
  122.         if (!$this->jobCards->contains($jobCard)) {
  123.             $this->jobCards->add($jobCard);
  124.             $jobCard->setCalendrier($this);
  125.         }
  126.         return $this;
  127.     }
  128.     public function removeJobCard(JobCard $jobCard): static
  129.     {
  130.         if ($this->jobCards->removeElement($jobCard)) {
  131.             // set the owning side to null (unless already changed)
  132.             if ($jobCard->getCalendrier() === $this) {
  133.                 $jobCard->setCalendrier(null);
  134.             }
  135.         }
  136.         return $this;
  137.     }
  138. }