File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -19,25 +19,22 @@ We begin this tutorial with the model for a ``User`` document:
19
19
namespace App\Document;
20
20
21
21
use Doctrine\Bundle\MongoDBBundle\Validator\Constraints\Unique as MongoDBUnique;
22
- use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB ;
22
+ use Doctrine\ODM\MongoDB\Mapping\Annotations as ODM ;
23
23
use Symfony\Component\Validator\Constraints as Assert;
24
24
25
- #[MongoDB \Document(collection: 'users')]
26
- #[MongoDB \Unique(fields: 'email')]
25
+ #[ODM \Document(collection: 'users')]
26
+ #[ODM \Unique(fields: 'email')]
27
27
class User
28
28
{
29
- /**
30
- * @MongoDB\Id
31
- */
32
- #[MongoDB\Id]
29
+ #[ODM\Id]
33
30
protected string $id;
34
31
35
- #[MongoDB \Field(type: 'string')]
32
+ #[ODM \Field(type: 'string')]
36
33
#[Assert\NotBlank]
37
34
#[Assert\Email]
38
35
protected ?string $email = null;
39
36
40
- #[MongoDB \Field(type: 'string')]
37
+ #[ODM \Field(type: 'string')]
41
38
#[Assert\NotBlank]
42
39
protected ?string $password = null;
43
40
You can’t perform that action at this time.
0 commit comments