src/Entity/Decision.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\DecisionRepository;
  4. use DateTimeImmutable;
  5. use Doctrine\Common\Collections\ArrayCollection;
  6. use Doctrine\Common\Collections\Collection;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClass: DecisionRepository::class)]
  10. class Decision
  11. {
  12.     #[ORM\Id]
  13.     #[ORM\GeneratedValue]
  14.     #[ORM\Column]
  15.     private ?int $id = null;
  16.     #[ORM\Column(length: 255)]
  17.     private ?string $label = null;
  18.     #[ORM\Column(type: 'datetime_immutable', nullable: true)]
  19.     private ?DateTimeImmutable $instructionDate = null;
  20.    
  21.     #[ORM\Column(type: 'datetime_immutable', nullable: true)]
  22.     private ?DateTimeImmutable $endDate = null;
  23.     #[ORM\Column(type: Types::TEXT, nullable: true)]
  24.     private ?string $observation = null;
  25.     #[ORM\ManyToOne]
  26.     #[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
  27.     private ?Meeting $meeting = null;
  28.     #[ORM\ManyToOne]
  29.     #[ORM\JoinColumn(nullable: false)]
  30.     private ?Structure $structure = null;
  31.     #[ORM\ManyToOne]
  32.     #[ORM\JoinColumn(nullable: true)]
  33.     private ?ExecutionLevel $executionLevel = null;
  34.     #[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'decisions')]
  35.     private Collection $monitoringOfficer;
  36.     #[ORM\Column(length: 255, nullable: true)]
  37.     private ?string $attachments = null;
  38.     #[ORM\ManyToOne]
  39.     private ?User $createdBy = null;
  40.     #[ORM\ManyToOne]
  41.     private ?User $updatedBy = null;
  42.     #[ORM\Column]
  43.     private ?DateTimeImmutable $createdAt = null;
  44.     #[ORM\Column(nullable: true)]
  45.     private ?DateTimeImmutable $updatedAt = null;
  46.     #[ORM\ManyToOne(inversedBy: 'decisions')]
  47.     private ?Structure $structrue = null;
  48.     public function __construct()
  49.     {
  50.         $this->monitoringOfficer = new ArrayCollection();
  51.         $this->createdAt = new DateTimeImmutable();
  52.         $this->updatedAt = new DateTimeImmutable();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getLabel(): ?string
  59.     {
  60.         return $this->label;
  61.     }
  62.     public function setLabel(string $label): self
  63.     {
  64.         $this->label = $label;
  65.         return $this;
  66.     }
  67.     public function getInstructionDate(): ?DateTimeImmutable
  68.     {
  69.         return $this->instructionDate;
  70.     }
  71.     public function setInstructionDate(DateTimeImmutable $instructionDate): self
  72.     {
  73.         $this->instructionDate = $instructionDate;
  74.         return $this;
  75.     }
  76.     public function getEndDate(): ?DateTimeImmutable
  77.     {
  78.         return $this->endDate;
  79.     }
  80.     public function setEndDate(?DateTimeImmutable $endDate): self
  81.     {
  82.         $this->endDate = $endDate;
  83.         return $this;
  84.     }
  85.     public function getObservation(): ?string
  86.     {
  87.         return $this->observation;
  88.     }
  89.     public function setObservation(?string $observation): self
  90.     {
  91.         $this->observation = $observation;
  92.         return $this;
  93.     }
  94.     public function getMeeting(): ?Meeting
  95.     {
  96.         return $this->meeting;
  97.     }
  98.     public function setMeeting(?Meeting $meeting): self
  99.     {
  100.         $this->meeting = $meeting;
  101.         return $this;
  102.     }
  103.   
  104.     public function getStructure(): ?Structure
  105.     {
  106.         return $this->structure;
  107.     }
  108.     public function setStructure(?Structure $structure): self
  109.     {
  110.         $this->structure = $structure;
  111.         return $this;
  112.     }
  113.     public function getExecutionLevel(): ?ExecutionLevel
  114.     {
  115.         return $this->executionLevel;
  116.     }
  117.     public function setExecutionLevel(?ExecutionLevel $executionLevel): self
  118.     {
  119.         $this->executionLevel = $executionLevel;
  120.         return $this;
  121.     }
  122.     /**
  123.      * @return Collection<int, User>
  124.      */
  125.     public function getMonitoringOfficer(): Collection
  126.     {
  127.         return $this->monitoringOfficer;
  128.     }
  129.     public function addMonitoringOfficer(User $monitoringOfficer): self
  130.     {
  131.         if (!$this->monitoringOfficer->contains($monitoringOfficer)) {
  132.             $this->monitoringOfficer->add($monitoringOfficer);
  133.         }
  134.         return $this;
  135.     }
  136.     public function removeMonitoringOfficer(User $monitoringOfficer): self
  137.     {
  138.         $this->monitoringOfficer->removeElement($monitoringOfficer);
  139.         return $this;
  140.     }
  141.     public function getAttachments(): ?string
  142.     {
  143.         return $this->attachments;
  144.     }
  145.     public function setAttachments(?string $attachments): self
  146.     {
  147.         $this->attachments = $attachments;
  148.         return $this;
  149.     }
  150.     public function getCreatedBy(): ?User
  151.     {
  152.         return $this->createdBy;
  153.     }
  154.     public function setCreatedBy(?User $createdBy): self
  155.     {
  156.         $this->createdBy = $createdBy;
  157.         return $this;
  158.     }
  159.     public function getUpdatedBy(): ?User
  160.     {
  161.         return $this->updatedBy;
  162.     }
  163.     public function setUpdatedBy(?User $updatedBy): self
  164.     {
  165.         $this->updatedBy = $updatedBy;
  166.         return $this;
  167.     }
  168.     public function getCreatedAt(): ?DateTimeImmutable
  169.     {
  170.         return $this->createdAt;
  171.     }
  172.     public function setCreatedAt(DateTimeImmutable $createdAt): self
  173.     {
  174.         $this->createdAt = $createdAt;
  175.         return $this;
  176.     }
  177.     public function getUpdatedAt(): ?DateTimeImmutable
  178.     {
  179.         return $this->updatedAt;
  180.     }
  181.     public function setUpdatedAt(?DateTimeImmutable $updatedAt): self
  182.     {
  183.         $this->updatedAt = $updatedAt;
  184.         return $this;
  185.     }
  186.     public function getStructrue(): ?Structure
  187.     {
  188.         return $this->structrue;
  189.     }
  190.     public function setStructrue(?Structure $structrue): static
  191.     {
  192.         $this->structrue = $structrue;
  193.         return $this;
  194.     }
  195. }