<?php
namespace App\Entity;
use App\Repository\CategoryRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=CategoryRepository::class)
*/
class Category
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255)
*/
private $name;
/**
* @ORM\OneToMany(targetEntity=Questions::class, mappedBy="category", orphanRemoval=true)
* @ORM\JoinColumn(nullable=false)
*/
private $questions;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $description;
/**
* @ORM\OneToMany(targetEntity=Applications::class, mappedBy="category", orphanRemoval=true)
*/
private $applications;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $image;
/**
* @ORM\Column(type="string", length=125, nullable=true)
*/
private $webhook;
/**
* @ORM\Column(name="message_accept", type="text", nullable=true)
*/
private $messageAccept;
/**
* @ORM\Column(name="message_deny", type="text", nullable=true)
*/
private $messageDeny;
/**
* @ORM\Column(type="boolean", nullable=true)
*/
private $enabled;
public function __construct()
{
$this->questions = new ArrayCollection();
$this->applications = new ArrayCollection();
}
public function getId(): ?int
{
return $this->id;
}
public function getName(): ?string
{
return $this->name;
}
public function setName(string $name): self
{
$this->name = $name;
return $this;
}
/**
* @return Collection<int, Questions>
*/
public function getQuestions(): Collection
{
return $this->questions;
}
public function addQuestion(Questions $question): self
{
if (!$this->questions->contains($question)) {
$this->questions[] = $question;
$question->setCategory($this);
}
return $this;
}
public function removeQuestion(Questions $question): self
{
if ($this->questions->removeElement($question)) {
// set the owning side to null (unless already changed)
if ($question->getCategory() === $this) {
$question->setCategory(null);
}
}
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
/**
* @return Collection<int, Applications>
*/
public function getApplications(): Collection
{
return $this->applications;
}
public function addApplication(Applications $application): self
{
if (!$this->applications->contains($application)) {
$this->applications[] = $application;
$application->setCategory($this);
}
return $this;
}
public function removeApplication(Applications $application): self
{
if ($this->applications->removeElement($application)) {
// set the owning side to null (unless already changed)
if ($application->getCategory() === $this) {
$application->setCategory(null);
}
}
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function getWebhook(): ?string
{
return $this->webhook;
}
public function setWebhook(?string $webhook): self
{
$this->webhook = $webhook;
return $this;
}
public function getMessageAccept(): ?string
{
return $this->messageAccept;
}
public function setMessageAccept(?string $messageAccept): self
{
$this->messageAccept = $messageAccept;
return $this;
}
public function getMessageDeny(): ?string
{
return $this->messageDeny;
}
public function setMessageDeny(?string $messageDeny): self
{
$this->messageDeny = $messageDeny;
return $this;
}
public function getEnabled(): ?bool
{
return $this->enabled;
}
public function setEnabled(?bool $enabled): self
{
$this->enabled = $enabled;
return $this;
}
}