You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Readme.md
+27-3Lines changed: 27 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,10 +21,9 @@ final class EmailUser
21
21
{
22
22
/**
23
23
* @Assert\NotBlank
24
-
* @Assert\Uuid
25
24
* @EntityExist(entity="App\Entity\User")
26
25
*
27
-
* @var string UUID to user's id property
26
+
* @var int User's id property
28
27
*/
29
28
private $user;
30
29
@@ -39,6 +38,31 @@ final class EmailUser
39
38
// ...
40
39
```
41
40
41
+
In case you are using other constraints to validate the property before entity should be checked in the database (like `@Assert\Uuid`) you should use [Group sequence](https://symfony.com/doc/current/validation/sequence_provider.html) in order to avoid 500 errors from Doctrine mapping.
42
+
43
+
```php
44
+
namespace App\Message\Command;
45
+
46
+
use Happyr\Validator\Constraint\EntityExist;
47
+
use Symfony\Component\Validator\Constraints as Assert;
0 commit comments