src/Entity/Category.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\CategoryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=CategoryRepository::class)
  9.  */
  10. class Category
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=255)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\OneToMany(targetEntity=Questions::class, mappedBy="category", orphanRemoval=true)
  24.      * @ORM\JoinColumn(nullable=false)
  25.      */
  26.     private $questions;
  27.     /**
  28.      * @ORM\Column(type="text", nullable=true)
  29.      */
  30.     private $description;
  31.     /**
  32.      * @ORM\OneToMany(targetEntity=Applications::class, mappedBy="category", orphanRemoval=true)
  33.      */
  34.     private $applications;
  35.     /**
  36.      * @ORM\Column(type="string", length=255, nullable=true)
  37.      */
  38.     private $image;
  39.     /**
  40.      * @ORM\Column(type="string", length=125, nullable=true)
  41.      */
  42.     private $webhook;
  43.     /**
  44.      * @ORM\Column(name="message_accept", type="text", nullable=true)
  45.      */
  46.     private $messageAccept;
  47.     /**
  48.      * @ORM\Column(name="message_deny", type="text", nullable=true)
  49.      */
  50.     private $messageDeny;
  51.     /**
  52.      * @ORM\Column(type="boolean", nullable=true)
  53.      */
  54.     private $enabled;
  55.     public function __construct()
  56.     {
  57.         $this->questions = new ArrayCollection();
  58.         $this->applications = new ArrayCollection();
  59.     }
  60.     public function getId(): ?int
  61.     {
  62.         return $this->id;
  63.     }
  64.     public function getName(): ?string
  65.     {
  66.         return $this->name;
  67.     }
  68.     public function setName(string $name): self
  69.     {
  70.         $this->name $name;
  71.         return $this;
  72.     }
  73.     /**
  74.      * @return Collection<int, Questions>
  75.      */
  76.     public function getQuestions(): Collection
  77.     {
  78.         return $this->questions;
  79.     }
  80.     public function addQuestion(Questions $question): self
  81.     {
  82.         if (!$this->questions->contains($question)) {
  83.             $this->questions[] = $question;
  84.             $question->setCategory($this);
  85.         }
  86.         return $this;
  87.     }
  88.     public function removeQuestion(Questions $question): self
  89.     {
  90.         if ($this->questions->removeElement($question)) {
  91.             // set the owning side to null (unless already changed)
  92.             if ($question->getCategory() === $this) {
  93.                 $question->setCategory(null);
  94.             }
  95.         }
  96.         return $this;
  97.     }
  98.     public function getDescription(): ?string
  99.     {
  100.         return $this->description;
  101.     }
  102.     public function setDescription(string $description): self
  103.     {
  104.         $this->description $description;
  105.         return $this;
  106.     }
  107.     /**
  108.      * @return Collection<int, Applications>
  109.      */
  110.     public function getApplications(): Collection
  111.     {
  112.         return $this->applications;
  113.     }
  114.     public function addApplication(Applications $application): self
  115.     {
  116.         if (!$this->applications->contains($application)) {
  117.             $this->applications[] = $application;
  118.             $application->setCategory($this);
  119.         }
  120.         return $this;
  121.     }
  122.     public function removeApplication(Applications $application): self
  123.     {
  124.         if ($this->applications->removeElement($application)) {
  125.             // set the owning side to null (unless already changed)
  126.             if ($application->getCategory() === $this) {
  127.                 $application->setCategory(null);
  128.             }
  129.         }
  130.         return $this;
  131.     }
  132.     public function getImage(): ?string
  133.     {
  134.         return $this->image;
  135.     }
  136.     public function setImage(?string $image): self
  137.     {
  138.         $this->image $image;
  139.         return $this;
  140.     }
  141.     public function getWebhook(): ?string
  142.     {
  143.         return $this->webhook;
  144.     }
  145.     public function setWebhook(?string $webhook): self
  146.     {
  147.         $this->webhook $webhook;
  148.         return $this;
  149.     }
  150.     public function getMessageAccept(): ?string
  151.     {
  152.         return $this->messageAccept;
  153.     }
  154.     public function setMessageAccept(?string $messageAccept): self
  155.     {
  156.         $this->messageAccept $messageAccept;
  157.         return $this;
  158.     }
  159.     public function getMessageDeny(): ?string
  160.     {
  161.         return $this->messageDeny;
  162.     }
  163.     public function setMessageDeny(?string $messageDeny): self
  164.     {
  165.         $this->messageDeny $messageDeny;
  166.         return $this;
  167.     }
  168.     public function getEnabled(): ?bool
  169.     {
  170.         return $this->enabled;
  171.     }
  172.     public function setEnabled(?bool $enabled): self
  173.     {
  174.         $this->enabled $enabled;
  175.         return $this;
  176.     }
  177. }