src/Entity/AppraisalCategory.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\AppraisalCategoryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Symfony\Component\Serializer\Annotation\Groups;
  7. use Doctrine\DBAL\Types\Types;
  8. use Doctrine\ORM\Mapping as ORM;
  9. #[ORM\Entity(repositoryClassAppraisalCategoryRepository::class)]
  10. class AppraisalCategory
  11. {
  12.     #[Groups(['LogService'])]
  13.     #[ORM\Id]
  14.     #[ORM\GeneratedValue]
  15.     #[ORM\Column]
  16.     private ?int $id null;
  17.     #[Groups(['LogService''Appraisal'])]
  18.     #[ORM\Column(length255)]
  19.     private ?string $title null;
  20.     #[Groups(['LogService'])]
  21.     #[ORM\Column(length64)]
  22.     private ?string $type null;
  23.     #[Groups(['LogService'])]
  24.     #[ORM\ManyToOne]
  25.     private ?Department $department null;
  26.     #[ORM\OneToMany(mappedBy'appraisalCategory'targetEntityAppraisalForm::class, cascade: ['persist''remove'])]
  27.     private Collection $questionnaire;
  28.     #[ORM\Column(typeTypes::SMALLINTnullabletrueoptions: ['default' => 0])]
  29.     private ?int $customOrder 0;
  30.     #[Groups(['LogService'])]
  31.     #[ORM\Column(type'boolean'options: ['default' => false])]
  32.     private ?bool $isHidden false;
  33.     #[Groups(['LogService'])]
  34.     #[ORM\ManyToOne]
  35.     #[ORM\JoinColumn(nullablefalse)]
  36.     private ?User $createdBy null;
  37.     
  38.     #[Groups(['LogService'])]
  39.     #[ORM\Column]
  40.     private ?\DateTimeImmutable $createdAt null;
  41.     #[Groups(['LogService'])]
  42.     #[ORM\ManyToOne]
  43.     private ?User $updatedBy null;
  44.     #[Groups(['LogService'])]
  45.     #[ORM\Column(nullabletrue)]
  46.     private ?\DateTimeImmutable $updatedAt null;
  47.     #[ORM\ManyToOne(inversedBy'appraisalCategories')]
  48.     #[ORM\JoinColumn(nullablefalse)]
  49.     private ?Company $company null;
  50.     public function __construct()
  51.     {
  52.         $this->questionnaire = new ArrayCollection();
  53.     }
  54.     public function getId(): ?int
  55.     {
  56.         return $this->id;
  57.     }
  58.     public function getTitle(): ?string
  59.     {
  60.         return $this->title;
  61.     }
  62.     public function setTitle(string $title): self
  63.     {
  64.         $this->title $title;
  65.         return $this;
  66.     }
  67.     public function getType(): ?string
  68.     {
  69.         return $this->type;
  70.     }
  71.     public function setType(string $type): self
  72.     {
  73.         $this->type $type;
  74.         return $this;
  75.     }
  76.     public function getDepartment(): ?Department
  77.     {
  78.         return $this->department;
  79.     }
  80.     public function setDepartment(?Department $department): self
  81.     {
  82.         $this->department $department;
  83.         return $this;
  84.     }
  85.     /**
  86.      * @return Collection<int, AppraisalForm>
  87.      */
  88.     public function getQuestionnaire(): Collection
  89.     {
  90.         return $this->questionnaire;
  91.     }
  92.     public function addQuestionnaire(AppraisalForm $questionnaire): self
  93.     {
  94.         if (!$this->questionnaire->contains($questionnaire)) {
  95.             $this->questionnaire->add($questionnaire);
  96.             $questionnaire->setAppraisalCategory($this);
  97.         }
  98.         return $this;
  99.     }
  100.     public function removeQuestionnaire(AppraisalForm $questionnaire): self
  101.     {
  102.         if ($this->questionnaire->removeElement($questionnaire)) {
  103.             // set the owning side to null (unless already changed)
  104.             if ($questionnaire->getAppraisalCategory() === $this) {
  105.                 $questionnaire->setAppraisalCategory(null);
  106.             }
  107.         }
  108.         return $this;
  109.     }
  110.     public function getCustomOrder(): ?int
  111.     {
  112.         return $this->customOrder;
  113.     }
  114.     public function setCustomOrder(int $customOrder): self
  115.     {
  116.         $this->customOrder $customOrder;
  117.         return $this;
  118.     }
  119.     public function getIsHidden(): ?bool
  120.     {
  121.         return $this->isHidden;
  122.     }
  123.     public function setIsHidden(bool $isHidden): self
  124.     {
  125.         $this->isHidden $isHidden;
  126.         return $this;
  127.     }
  128.     public function getCreatedBy(): ?User
  129.     {
  130.         return $this->createdBy;
  131.     }
  132.     public function setCreatedBy(?User $createdBy): self
  133.     {
  134.         $this->createdBy $createdBy;
  135.         return $this;
  136.     }
  137.     public function getCreatedAt(): ?\DateTimeImmutable
  138.     {
  139.         return $this->createdAt;
  140.     }
  141.     public function setCreatedAt(\DateTimeImmutable $createdAt): self
  142.     {
  143.         $this->createdAt $createdAt;
  144.         return $this;
  145.     }
  146.     public function getUpdatedBy(): ?User
  147.     {
  148.         return $this->updatedBy;
  149.     }
  150.     public function setUpdatedBy(?User $updatedBy): self
  151.     {
  152.         $this->updatedBy $updatedBy;
  153.         return $this;
  154.     }
  155.     public function getUpdatedAt(): ?\DateTimeImmutable
  156.     {
  157.         return $this->updatedAt;
  158.     }
  159.     public function setUpdatedAt(?\DateTimeImmutable $updatedAt): self
  160.     {
  161.         $this->updatedAt $updatedAt;
  162.         return $this;
  163.     }
  164.     public function getCompany(): ?Company
  165.     {
  166.         return $this->company;
  167.     }
  168.     public function setCompany(?Company $company): self
  169.     {
  170.         $this->company $company;
  171.         return $this;
  172.     }
  173. }