Skip to content

Commit 22448c9

Browse files
committed
Merge branch '4.2'
* 4.2: Corrected class name in example
2 parents 28a257f + 595f309 commit 22448c9

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

reference/constraints/UniqueEntity.rst

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ between all of the constraints in your user table:
3636

3737
.. code-block:: php-annotations
3838
39-
// src/Entity/Author.php
39+
// src/Entity/User.php
4040
namespace App\Entity;
4141
4242
use Symfony\Component\Validator\Constraints as Assert;
@@ -49,7 +49,7 @@ between all of the constraints in your user table:
4949
* @ORM\Entity
5050
* @UniqueEntity("email")
5151
*/
52-
class Author
52+
class User
5353
{
5454
/**
5555
* @ORM\Column(name="email", type="string", length=255, unique=true)
@@ -61,7 +61,7 @@ between all of the constraints in your user table:
6161
.. code-block:: yaml
6262
6363
# config/validator/validation.yaml
64-
App\Entity\Author:
64+
App\Entity\User:
6565
constraints:
6666
- Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity: email
6767
properties:
@@ -76,7 +76,7 @@ between all of the constraints in your user table:
7676
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
7777
xsi:schemaLocation="http://symfony.com/schema/dic/constraint-mapping https://symfony.com/schema/dic/constraint-mapping/constraint-mapping-1.0.xsd">
7878
79-
<class name="App\Entity\Author">
79+
<class name="App\Entity\User">
8080
<constraint name="Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity">
8181
<option name="fields">email</option>
8282
</constraint>
@@ -88,15 +88,15 @@ between all of the constraints in your user table:
8888
8989
.. code-block:: php
9090
91-
// src/Entity/Author.php
91+
// src/Entity/User.php
9292
namespace App\Entity;
9393
9494
use Symfony\Component\Validator\Constraints as Assert;
9595
9696
// DON'T forget this use statement!!!
9797
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
9898
99-
class Author
99+
class User
100100
{
101101
public static function loadValidatorMetadata(ClassMetadata $metadata)
102102
{

0 commit comments

Comments
 (0)