<?php
namespace App\Entity;
use App\Repository\PointCategoryItemRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use JMS\Serializer\Annotation\Groups;
/**
* @ORM\Entity(repositoryClass=PointCategoryItemRepository::class)
* @UniqueEntity(
* fields={"slug"},
* errorPath="slug",
* message="Ce slug est déjà utilisé, veuillez en choisir un autre."
* )
*/
class PointCategoryItem
{
/**
* @ORM\Id
* @ORM\GeneratedValue
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=255, unique=true)
*
* @Groups({ "pointCategory" })
*/
private ?string $slug;
/**
* @ORM\Column(type="string", length=255)
*
* @Groups({ "pointCategory" })
*/
private ?string $label;
/**
* @ORM\Column(type="string", length=255)
*
* @Groups({ "pointCategory" })
*/
private ?string $symbol;
/**
* @ORM\Column(type="float", nullable=true)
*
* @Groups({ "pointCategory" })
*/
private ?float $multiplication;
/**
* @ORM\ManyToOne(targetEntity=PointCategory::class, inversedBy="pointCategoryItems")
* @ORM\JoinColumn(nullable=false)
*/
private ?PointCategory $pointCategory = null;
/**
* @ORM\Column(type="boolean", nullable=true)
*
* @Groups({ "pointCategory" })
*/
private ?bool $pointCategoryDefault = false;
public function getId(): ?int
{
return $this->id;
}
public function getSlug(): ?string
{
return $this->slug;
}
public function setSlug(string $slug): self
{
$this->slug = $slug;
return $this;
}
public function getLabel(): ?string
{
return $this->label;
}
public function setLabel(string $label): self
{
$this->label = $label;
return $this;
}
public function getSymbol(): ?string
{
return $this->symbol;
}
public function setSymbol(string $symbol): self
{
$this->symbol = $symbol;
return $this;
}
public function getMultiplication(): ?float
{
return $this->multiplication;
}
public function setMultiplication(?float $multiplication): self
{
$this->multiplication = $multiplication;
return $this;
}
public function getPointCategory(): ?PointCategory
{
return $this->pointCategory;
}
public function setPointCategory(?PointCategory $pointCategory): self
{
$this->pointCategory = $pointCategory;
return $this;
}
public function isPointCategoryDefault(): ?bool
{
return $this->pointCategoryDefault;
}
public function setPointCategoryDefault(?bool $pointCategoryDefault): self
{
$this->pointCategoryDefault = $pointCategoryDefault;
return $this;
}
}