src/Entity/Gos/CustomerServiceMessageCategory.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity\Gos;
  3. use App\Repository\CustomerServiceMessageCategoryRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * @ORM\Entity(repositoryClass=CustomerServiceMessageCategoryRepository::class)
  8.  * @ORM\HasLifecycleCallbacks
  9.  */
  10. class CustomerServiceMessageCategory
  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="CustomerServiceMessage", mappedBy="category")
  24.      */
  25.     private $messages;
  26.     /**
  27.      * @ORM\Column(type="boolean")
  28.      */
  29.     private $isMaster;
  30.     /**
  31.      * @ORM\Column(type="string", length=255, nullable=true)
  32.      */
  33.     private $color;
  34.     /**
  35.      * @ORM\ManyToOne(targetEntity="CustomerServiceMessageCategory", inversedBy="subcategories")
  36.      * @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
  37.      */
  38.     private $parentCategory;
  39.     /**
  40.      * @ORM\OneToMany(targetEntity="CustomerServiceMessageCategory", mappedBy="parentCategory")
  41.      */
  42.     private $subcategories;
  43.     /**
  44.      * @ORM\Column(type="text", nullable=true)
  45.      */
  46.     private $keywords;
  47.     /**
  48.      * @ORM\Column(type="string")
  49.      */
  50.     private $officeEmail;
  51.     /**
  52.      * @ORM\Column(type="datetime", nullable=true)
  53.      */
  54.     private $createdAt;
  55.     /**
  56.      * @ORM\Column(type="datetime", nullable=true)
  57.      */
  58.     private $updatedAt;
  59.     /** @ORM\PrePersist() */
  60.     public function prePersist()
  61.     {
  62.         $this->createdAt = new \DateTime();
  63.     }
  64.     /** @ORM\PreUpdate() */
  65.     public function preUpdate()
  66.     {
  67.         $this->updatedAt = new \DateTime();
  68.     }
  69.     public function __construct()
  70.     {
  71.         $this->messages         = new ArrayCollection();
  72.         $this->subcategories    = new ArrayCollection();
  73.     }
  74.     public function getId(): ?int
  75.     {
  76.         return $this->id;
  77.     }
  78.     public function getName(): ?string
  79.     {
  80.         return $this->name;
  81.     }
  82.     public function setName(string $name): self
  83.     {
  84.         $this->name $name;
  85.         return $this;
  86.     }
  87.     public function getMessages()
  88.     {
  89.         return $this->messages;
  90.     }
  91.     public function setMessages($messages): self
  92.     {
  93.         $this->messages $messages;
  94.         return $this;
  95.     }
  96.     public function addMessage(CustomerServiceMessage $message): self
  97.     {
  98.         $this->messages[] = $message;
  99.         return $this;
  100.     }
  101.     public function removeMessage(CustomerServiceMessage $message)
  102.     {
  103.         $this->messages->removeElement($message);
  104.     }
  105.     public function getIsMaster(): ?bool
  106.     {
  107.         return $this->isMaster;
  108.     }
  109.     public function setIsMaster(?bool $isMaster): self
  110.     {
  111.         $this->isMaster $isMaster;
  112.         return $this;
  113.     }
  114.     public function getColor(): ?string
  115.     {
  116.         return $this->color;
  117.     }
  118.     public function setColor(?string $color): self
  119.     {
  120.         $this->color $color;
  121.         return $this;
  122.     }
  123.     public function getParentCategory(): ?CustomerServiceMessageCategory
  124.     {
  125.         return $this->parentCategory;
  126.     }
  127.     public function setParentCategory(?CustomerServiceMessageCategory $parentCategory): self
  128.     {
  129.         $this->parentCategory $parentCategory;
  130.         return $this;
  131.     }
  132.     public function getSubcategories()
  133.     {
  134.         return $this->subcategories;
  135.     }
  136.     public function setSubcategories($subcategories): self
  137.     {
  138.         $this->subcategories $subcategories;
  139.         return $this;
  140.     }
  141.     public function addSubcategories(CustomerServiceMessageCategory $category): self
  142.     {
  143.         $this->subcategories[] = $category;
  144.         return $this;
  145.     }
  146.     public function removeSubcategories(CustomerServiceMessageCategory $category)
  147.     {
  148.         $this->subcategories->removeElement($category);
  149.     }
  150.     public function getKeywords(): ?string
  151.     {
  152.         return $this->keywords;
  153.     }
  154.     public function setKeywords(?string $keywords): self
  155.     {
  156.         $this->keywords $keywords;
  157.     }
  158.     public function getOfficeEmail(): ?string
  159.     {
  160.         return $this->officeEmail;
  161.     }
  162.     public function setOfficeEmail(?string $officeEmail): self
  163.     {
  164.         $this->officeEmail $officeEmail;
  165.         return $this;
  166.     }
  167.     public function __toString()
  168.     {
  169.         return $this->name;
  170.     }
  171. }