src/Entity/DnsitProductCategory.php line 15

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. /**
  7.  * DnsitProductCategory
  8.  *
  9.  * @ORM\Table(name="dnsit_product_category")
  10.  * @ORM\Entity
  11.  */
  12. class DnsitProductCategory
  13. {
  14.     /**
  15.      * @var string|null
  16.      *
  17.      * @ORM\Column(name="name", type="string", length=255, nullable=true)
  18.      */
  19.     private $name;
  20.     /**
  21.      * @var int|null
  22.      *
  23.      * @ORM\Column(name="entity", type="bigint", nullable=true)
  24.      */
  25.     private $entity;
  26.     /**
  27.      * @var int|null
  28.      *
  29.      * @ORM\Column(name="marking", type="smallint", nullable=true)
  30.      */
  31.     private $marking;
  32.     /**
  33.      * @var string|null
  34.      *
  35.      * @ORM\Column(name="params", type="text", nullable=true)
  36.      */
  37.     private $params;
  38.     /**
  39.      * @var \DateTime|null
  40.      *
  41.      * @ORM\Column(name="created_at", type="datetime", nullable=true)
  42.      */
  43.     private $createdAt;
  44.     /**
  45.      * @var int|null
  46.      *
  47.      * @ORM\Column(name="created_by", type="bigint", nullable=true)
  48.      */
  49.     private $createdBy;
  50.     /**
  51.      * @var \DateTime|null
  52.      *
  53.      * @ORM\Column(name="updated_at", type="datetime", nullable=true)
  54.      */
  55.     private $updatedAt;
  56.     /**
  57.      * @var int|null
  58.      *
  59.      * @ORM\Column(name="updated_by", type="bigint", nullable=true)
  60.      */
  61.     private $updatedBy;
  62.     /**
  63.      * @var int
  64.      *
  65.      * @ORM\Column(name="id", type="bigint")
  66.      * @ORM\Id
  67.      * @ORM\GeneratedValue(strategy="IDENTITY")
  68.      */
  69.     private $id;
  70.     /**
  71.      * @var \App\Entity\DnsitProductCategory
  72.      *
  73.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitProductCategory")
  74.      * @ORM\JoinColumns({
  75.      *   @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
  76.      * })
  77.      */
  78.     private $parent;
  79.     /**
  80.      * @var \App\Entity\DnsitTranslateProductCategory
  81.      *
  82.      * @ORM\ManyToOne(targetEntity="App\Entity\DnsitTranslateProductCategory")
  83.      * @ORM\JoinColumns({
  84.      *   @ORM\JoinColumn(name="translate_id", referencedColumnName="id")
  85.      * })
  86.      */
  87.     private $translate;
  88.     /**
  89.      * @var \Doctrine\Common\Collections\Collection
  90.      *
  91.      * @ORM\ManyToMany(targetEntity="App\Entity\DnsitProduct", mappedBy="category")
  92.      */
  93.     private $products;
  94.     /**
  95.      * Constructor
  96.      */
  97.     public function __construct()
  98.     {
  99.         $this->products = new \Doctrine\Common\Collections\ArrayCollection();
  100.     }
  101.     public function getName(): ?string
  102.     {
  103.         return $this->name;
  104.     }
  105.     public function setName(?string $name): self
  106.     {
  107.         $this->name $name;
  108.         return $this;
  109.     }
  110.     public function getEntity(): ?int
  111.     {
  112.         return $this->entity;
  113.     }
  114.     public function setEntity(?int $entity): self
  115.     {
  116.         $this->entity $entity;
  117.         return $this;
  118.     }
  119.     public function getMarking(): ?int
  120.     {
  121.         return $this->marking;
  122.     }
  123.     public function setMarking(?int $marking): self
  124.     {
  125.         $this->marking $marking;
  126.         return $this;
  127.     }
  128.     public function getParams(): ?string
  129.     {
  130.         return $this->params;
  131.     }
  132.     public function setParams(?string $params): self
  133.     {
  134.         $this->params $params;
  135.         return $this;
  136.     }
  137.     public function getCreatedAt(): ?\DateTimeInterface
  138.     {
  139.         return $this->createdAt;
  140.     }
  141.     public function setCreatedAt(?\DateTimeInterface $createdAt): self
  142.     {
  143.         $this->createdAt $createdAt;
  144.         return $this;
  145.     }
  146.     public function getCreatedBy(): ?int
  147.     {
  148.         return $this->createdBy;
  149.     }
  150.     public function setCreatedBy(?int $createdBy): self
  151.     {
  152.         $this->createdBy $createdBy;
  153.         return $this;
  154.     }
  155.     public function getUpdatedAt(): ?\DateTimeInterface
  156.     {
  157.         return $this->updatedAt;
  158.     }
  159.     public function setUpdatedAt(?\DateTimeInterface $updatedAt): self
  160.     {
  161.         $this->updatedAt $updatedAt;
  162.         return $this;
  163.     }
  164.     public function getUpdatedBy(): ?int
  165.     {
  166.         return $this->updatedBy;
  167.     }
  168.     public function setUpdatedBy(?int $updatedBy): self
  169.     {
  170.         $this->updatedBy $updatedBy;
  171.         return $this;
  172.     }
  173.     public function getId(): ?int
  174.     {
  175.         return $this->id;
  176.     }
  177.     public function getParent(): ?self
  178.     {
  179.         return $this->parent;
  180.     }
  181.     public function setParent(?self $parent): self
  182.     {
  183.         $this->parent $parent;
  184.         return $this;
  185.     }
  186.     public function getTranslate(): ?DnsitTranslateProductCategory
  187.     {
  188.         return $this->translate;
  189.     }
  190.     public function setTranslate(?DnsitTranslateProductCategory $translate): self
  191.     {
  192.         $this->translate $translate;
  193.         return $this;
  194.     }
  195.     /**
  196.      * @return Collection|DnsitProduct[]
  197.      */
  198.     public function getProducts(): Collection
  199.     {
  200.         return $this->products;
  201.     }
  202.     public function addProduct(DnsitProduct $product): self
  203.     {
  204.         if (!$this->products->contains($product)) {
  205.             $this->products[] = $product;
  206.             $product->addCategory($this);
  207.         }
  208.         return $this;
  209.     }
  210.     public function removeProduct(DnsitProduct $product): self
  211.     {
  212.         if ($this->products->contains($product)) {
  213.             $this->products->removeElement($product);
  214.             $product->removeCategory($this);
  215.         }
  216.         return $this;
  217.     }
  218.     public function __toString(){
  219.         return "DnsitProductCategory";
  220.     }
  221. }