14
14
use App \Repository \PostRepository ;
15
15
use Doctrine \Common \Collections \ArrayCollection ;
16
16
use Doctrine \Common \Collections \Collection ;
17
+ use Doctrine \DBAL \Types \Types ;
17
18
use Doctrine \ORM \Mapping as ORM ;
18
19
use Symfony \Bridge \Doctrine \Validator \Constraints \UniqueEntity ;
19
20
use Symfony \Component \Validator \Constraints as Assert ;
@@ -37,27 +38,27 @@ class Post
37
38
{
38
39
#[ORM \Id]
39
40
#[ORM \GeneratedValue]
40
- #[ORM \Column(type: ' integer ' )]
41
+ #[ORM \Column(type: Types:: INTEGER )]
41
42
private ?int $ id = null ;
42
43
43
- #[ORM \Column(type: ' string ' )]
44
+ #[ORM \Column(type: Types:: STRING )]
44
45
#[Assert \NotBlank]
45
46
private ?string $ title = null ;
46
47
47
- #[ORM \Column(type: ' string ' )]
48
+ #[ORM \Column(type: Types:: STRING )]
48
49
private ?string $ slug = null ;
49
50
50
- #[ORM \Column(type: ' string ' )]
51
+ #[ORM \Column(type: Types:: STRING )]
51
52
#[Assert \NotBlank(message: 'post.blank_summary ' )]
52
53
#[Assert \Length(max: 255 )]
53
54
private ?string $ summary = null ;
54
55
55
- #[ORM \Column(type: ' text ' )]
56
+ #[ORM \Column(type: Types:: TEXT )]
56
57
#[Assert \NotBlank(message: 'post.blank_content ' )]
57
58
#[Assert \Length(min: 10 , minMessage: 'post.too_short_content ' )]
58
59
private ?string $ content = null ;
59
60
60
- #[ORM \Column(type: ' datetime ' )]
61
+ #[ORM \Column(type: Types:: DATETIME_MUTABLE )]
61
62
private \DateTime $ publishedAt ;
62
63
63
64
#[ORM \ManyToOne(targetEntity: User::class)]
0 commit comments