34 lines
960 B
PHP
34 lines
960 B
PHP
<?php
|
|
|
|
namespace App\Entity;
|
|
|
|
use App\Repository\SettingRepository;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Symfony\Component\Validator\Constraints as Assert;
|
|
|
|
#[ORM\Entity(repositoryClass: SettingRepository::class)]
|
|
#[ORM\Table(name: 'settings')]
|
|
#[ORM\UniqueConstraint(name: 'uniq_setting_name', columns: ['name'])]
|
|
class Setting
|
|
{
|
|
#[ORM\Id]
|
|
#[ORM\GeneratedValue]
|
|
#[ORM\Column(type: 'integer')]
|
|
private ?int $id = null;
|
|
|
|
#[ORM\Column(type: 'string', length: 100)]
|
|
#[Assert\NotBlank]
|
|
private string $name = '';
|
|
|
|
#[ORM\Column(type: 'text', nullable: true)]
|
|
private ?string $value = null;
|
|
|
|
public function getId(): ?int { return $this->id; }
|
|
public function getName(): string { return $this->name; }
|
|
public function setName(string $name): void { $this->name = $name; }
|
|
public function getValue(): ?string { return $this->value; }
|
|
public function setValue(?string $value): void { $this->value = $value; }
|
|
}
|
|
|
|
|