src/Entity/LaBaseCategory.php line 13
<?php
namespace App\Entity;
use App\Repository\LaBaseCategoryRepository;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
#[ORM\Entity(repositoryClass: LaBaseCategoryRepository::class)]
class LaBaseCategory implements \Stringable
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: 'integer')]
private $id;
#[ORM\Column(type: 'boolean')]
private bool $enabled = false;
#[Assert\NotBlank]
#[ORM\Column(type: 'string', length: 255)]
private string $name;
#[ORM\Column(type: 'string')]
private string $color = '#17a2b8';
/**
* @Gedmo\SortablePosition
*/
#[ORM\Column]
private int $position = 0;
#[ORM\Column(type: 'datetime', nullable: true)]
private ?\DateTime $createdAt;
public function __construct()
{
$this->createdAt = new \DateTime();
}
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 getCreatedAt(): ?\DateTimeInterface
{
return $this->createdAt;
}
public function setCreatedAt(?\DateTimeInterface $createdAt): self
{
$this->createdAt = $createdAt;
return $this;
}
public function __toString(): string
{
return $this->name;
}
public function isEnabled(): bool
{
return $this->enabled;
}
public function setEnabled(bool $enabled): void
{
$this->enabled = $enabled;
}
public function getColor(): ?string
{
return $this->color;
}
public function setColor(?string $color): self
{
$this->color = $color;
return $this;
}
public function getPosition(): ?int
{
return $this->position;
}
public function setPosition(int $position): self
{
$this->position = $position;
return $this;
}
}