first commit symfony 6
This commit is contained in:
45
src/Entity/Whitelist.php
Normal file
45
src/Entity/Whitelist.php
Normal file
@ -0,0 +1,45 @@
|
||||
<?php
|
||||
namespace App\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
||||
|
||||
/**
|
||||
* @ORM\Entity
|
||||
* @ORM\Table(name="whitelist")
|
||||
* @ORM\HasLifecycleCallbacks()
|
||||
*
|
||||
* @UniqueEntity(fields="label", message="Une liste blanche existe déjà avec ce label")
|
||||
*/
|
||||
class Whitelist
|
||||
{
|
||||
/**
|
||||
* @ORM\Column(type="integer")
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=250, unique=true)
|
||||
*/
|
||||
private $label;
|
||||
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
public function getLabel(): ?string
|
||||
{
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
public function setLabel(string $label): self
|
||||
{
|
||||
$this->label = $label;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user