<?php
namespace App\Entity;
use App\Repository\ProductCategoryRepository;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass=ProductCategoryRepository::class)
*/
class ProductCategory
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $name;
/**
* @ORM\Column(type="smallint", nullable=true, options={"comment"="层级", "default"=1})
*/
private $level = 1;
/**
* @ORM\ManyToOne(targetEntity=ProductCategory::class)
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id", nullable=true)
*/
private $parent;
/**
* @ORM\Column(type="boolean", nullable=true, options={"comment"="十分可用", "default"=1})
*/
private $isEnabled = 1;
/**
* @ORM\Column(type="smallint", nullable=true, options={"comment"="排序升序", "default"=100})
*/
private $sortedBy = 100;
/**
* @ORM\Column(type="string", length=150, nullable=true)
*/
private $image;
/**
* @ORM\Column(type="boolean", nullable=true, options={"comment"="是否设置成金刚区", "default"=0})
*/
private $isHome = 0;
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;
}
public function getLevel(): ?int
{
return $this->level;
}
public function setLevel(?int $level): self
{
$this->level = $level;
return $this;
}
public function getParent(): ?self
{
return $this->parent;
}
public function setParent(?self $parent): self
{
$this->parent = $parent;
return $this;
}
public function getIsEnabled(): ?bool
{
return $this->isEnabled;
}
public function setIsEnabled(?bool $isEnabled): self
{
$this->isEnabled = $isEnabled;
return $this;
}
public function getSortedBy(): ?int
{
return $this->sortedBy;
}
public function setSortedBy(?int $sortedBy): self
{
$this->sortedBy = $sortedBy;
return $this;
}
public function getImage(): ?string
{
return $this->image;
}
public function setImage(?string $image): self
{
$this->image = $image;
return $this;
}
public function isIsHome(): ?bool
{
return $this->isHome;
}
public function setIsHome(?bool $isHome): self
{
$this->isHome = $isHome;
return $this;
}
}