File tree Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Expand file tree Collapse file tree 2 files changed +19
-12
lines changed Original file line number Diff line number Diff line change 1
1
### Unreleased
2
2
3
+ * [ BREAKING] Use doctrine attributes instead of annotations for entity metadata
4
+
3
5
### v1.5.0 (2024-10-01)
4
6
5
7
* Support PHP 8.3
Original file line number Diff line number Diff line change 7
7
namespace Ingenerator \ContentSnippets \Entity ;
8
8
9
9
10
- /**
11
- * @Entity
12
- * @ChangeTrackingPolicy("DEFERRED_EXPLICIT")
13
- * @Table(name="content_snippets")
14
- */
10
+ use Doctrine \DBAL \Types \Types ;
11
+ use Doctrine \ORM \Mapping \ChangeTrackingPolicy ;
12
+ use Doctrine \ORM \Mapping \Column ;
13
+ use Doctrine \ORM \Mapping \Entity ;
14
+ use Doctrine \ORM \Mapping \Id ;
15
+ use Doctrine \ORM \Mapping \Table ;
16
+
17
+ #[Entity]
18
+ #[ChangeTrackingPolicy('DEFERRED_EXPLICIT ' )]
19
+ #[Table(name: 'content_snippets ' )]
15
20
class ContentSnippet
16
21
{
17
22
18
23
/**
19
24
* @var string
20
- * @Id
21
- * @Column(type="string")
22
25
*/
26
+ #[Id]
27
+ #[Column(type: Types::STRING )]
23
28
protected $ slug ;
24
29
25
30
/**
26
31
* @var string
27
- * @Column(type="string")
28
32
*/
33
+ #[Column(type: Types::STRING )]
29
34
protected $ display_name ;
30
35
31
36
/**
32
37
* @var string
33
- * @Column(type="text", nullable=true)
34
38
*/
39
+ #[Column(type: Types::TEXT , nullable: TRUE )]
35
40
protected $ help_text ;
36
41
37
42
/**
38
43
* @var bool
39
- * @Column(type="boolean")
40
44
*/
45
+ #[Column(type: Types::BOOLEAN )]
41
46
protected $ allows_html ;
42
47
43
48
/**
44
49
* @var string
45
- * @Column(type="text", nullable=true)
46
50
*/
51
+ #[Column(type: Types::TEXT , nullable: TRUE )]
47
52
protected $ content ;
48
53
49
54
/**
50
55
* @var \DateTimeImmutable
51
- * @Column(type="datetime_immutable")
52
56
*/
57
+ #[Column(type: Types::DATETIME_IMMUTABLE )]
53
58
protected $ updated_at ;
54
59
55
60
/**
You can’t perform that action at this time.
0 commit comments