|
@@ -5,6 +5,7 @@ namespace App\Entity;
|
|
use App\Repository\ArticleRepository;
|
|
use App\Repository\ArticleRepository;
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\DBAL\Types\Types;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
use Doctrine\ORM\Mapping as ORM;
|
|
|
|
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
|
|
|
|
|
|
#[ORM\Entity(repositoryClass: ArticleRepository::class)]
|
|
#[ORM\Entity(repositoryClass: ArticleRepository::class)]
|
|
class Article
|
|
class Article
|
|
@@ -30,6 +31,9 @@ class Article
|
|
#[ORM\Column(length: 64)]
|
|
#[ORM\Column(length: 64)]
|
|
private ?string $state = null;
|
|
private ?string $state = null;
|
|
|
|
|
|
|
|
+ #[ORM\Column(length: 100, unique: false)]
|
|
|
|
+ private ?string $slug = null;
|
|
|
|
+
|
|
public function __construct(User $author)
|
|
public function __construct(User $author)
|
|
{
|
|
{
|
|
$this->setAuthor($author);
|
|
$this->setAuthor($author);
|
|
@@ -100,4 +104,16 @@ class Article
|
|
|
|
|
|
return $this;
|
|
return $this;
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+ public function getSlug(): ?string
|
|
|
|
+ {
|
|
|
|
+ return $this->slug;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ public function setSlug(string $slug): static
|
|
|
|
+ {
|
|
|
|
+ $this->slug = $slug;
|
|
|
|
+
|
|
|
|
+ return $this;
|
|
|
|
+ }
|
|
}
|
|
}
|