src/Entity/ProductCategory.php line 11

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\ProductCategoryRepository;
  4. use Doctrine\ORM\Mapping as ORM;
  5. /**
  6.  * @ORM\Entity(repositoryClass=ProductCategoryRepository::class)
  7.  */
  8. class ProductCategory
  9. {
  10.     /**
  11.      * @ORM\Id
  12.      * @ORM\GeneratedValue
  13.      * @ORM\Column(type="integer")
  14.      */
  15.     private $id;
  16.     /**
  17.      * @ORM\Column(type="string", length=100, nullable=true)
  18.      */
  19.     private $name;
  20.     /**
  21.      * @ORM\Column(type="smallint", nullable=true, options={"comment"="层级", "default"=1})
  22.      */
  23.     private $level 1;
  24.     /**
  25.      * @ORM\ManyToOne(targetEntity=ProductCategory::class)
  26.      * @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=true)
  27.      */
  28.     private $parent;
  29.     /**
  30.      * @ORM\Column(type="boolean", nullable=true, options={"comment"="十分可用", "default"=1})
  31.      */
  32.     private $isEnabled 1;
  33.     /**
  34.      * @ORM\Column(type="smallint", nullable=true, options={"comment"="排序升序", "default"=100})
  35.      */
  36.     private $sortedBy 100;
  37.     /**
  38.      * @ORM\Column(type="string", length=150, nullable=true)
  39.      */
  40.     private $image;
  41.     /**
  42.      * @ORM\Column(type="boolean", nullable=true, options={"comment"="是否设置成金刚区", "default"=0})
  43.      */
  44.     private $isHome 0;
  45.     public function getId(): ?int
  46.     {
  47.         return $this->id;
  48.     }
  49.     public function getName(): ?string
  50.     {
  51.         return $this->name;
  52.     }
  53.     public function setName(?string $name): self
  54.     {
  55.         $this->name $name;
  56.         return $this;
  57.     }
  58.     public function getLevel(): ?int
  59.     {
  60.         return $this->level;
  61.     }
  62.     public function setLevel(?int $level): self
  63.     {
  64.         $this->level $level;
  65.         return $this;
  66.     }
  67.     public function getParent(): ?self
  68.     {
  69.         return $this->parent;
  70.     }
  71.     public function setParent(?self $parent): self
  72.     {
  73.         $this->parent $parent;
  74.         return $this;
  75.     }
  76.     public function getIsEnabled(): ?bool
  77.     {
  78.         return $this->isEnabled;
  79.     }
  80.     public function setIsEnabled(?bool $isEnabled): self
  81.     {
  82.         $this->isEnabled $isEnabled;
  83.         return $this;
  84.     }
  85.     public function getSortedBy(): ?int
  86.     {
  87.         return $this->sortedBy;
  88.     }
  89.     public function setSortedBy(?int $sortedBy): self
  90.     {
  91.         $this->sortedBy $sortedBy;
  92.         return $this;
  93.     }
  94.     public function getImage(): ?string
  95.     {
  96.         return $this->image;
  97.     }
  98.     public function setImage(?string $image): self
  99.     {
  100.         $this->image $image;
  101.         return $this;
  102.     }
  103.     public function isIsHome(): ?bool
  104.     {
  105.         return $this->isHome;
  106.     }
  107.     public function setIsHome(?bool $isHome): self
  108.     {
  109.         $this->isHome $isHome;
  110.         return $this;
  111.     }
  112. }