We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 52ef1b7 commit a4a316aCopy full SHA for a4a316a
src/Entity/Post.php
@@ -14,11 +14,13 @@
14
use Doctrine\Common\Collections\ArrayCollection;
15
use Doctrine\Common\Collections\Collection;
16
use Doctrine\ORM\Mapping as ORM;
17
+use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
18
use Symfony\Component\Validator\Constraints as Assert;
19
20
/**
21
* @ORM\Entity(repositoryClass="App\Repository\PostRepository")
22
* @ORM\Table(name="symfony_demo_post")
23
+ * @UniqueEntity(fields={"slug"}, errorPath="title")
24
*
25
* Defines the properties of the Post entity to represent the blog posts.
26
0 commit comments