Skip to content

Commit

Permalink
Make blog post titles unique
Browse files Browse the repository at this point in the history
  • Loading branch information
javiereguiluz committed Jan 7, 2020
1 parent 52ef1b7 commit a4a316a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/Entity/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;

/**
* @ORM\Entity(repositoryClass="App\Repository\PostRepository")
* @ORM\Table(name="symfony_demo_post")
* @UniqueEntity(fields={"slug"}, errorPath="title")
*
* Defines the properties of the Post entity to represent the blog posts.
*
Expand Down

0 comments on commit a4a316a

Please sign in to comment.