File tree Expand file tree Collapse file tree 4 files changed +29
-69
lines changed Expand file tree Collapse file tree 4 files changed +29
-69
lines changed Original file line number Diff line number Diff line change 1313 'mappings ' => [
1414 'TestEntities ' => [
1515 'is_bundle ' => false ,
16- 'type ' => 'annotation ' ,
16+ 'type ' => 'attribute ' ,
1717 'dir ' => '%kernel.project_dir%/src/Entity ' ,
1818 'prefix ' => 'EasyCorp\Bundle\EasyAdminBundle\Tests\TestApplication\Entity ' ,
1919 'alias ' => 'app ' ,
Original file line number Diff line number Diff line change 66use Doctrine \Common \Collections \Collection ;
77use Doctrine \ORM \Mapping as ORM ;
88
9- /**
10- * @ORM\Entity
11- */
9+ #[ORM \Entity]
1210class BlogPost
1311{
14- /**
15- * @ORM\Id
16- * @ORM\GeneratedValue
17- * @ORM\Column(type="integer")
18- */
12+ #[ORM \Id]
13+ #[ORM \GeneratedValue]
14+ #[ORM \Column(type: 'integer ' )]
1915 private $ id ;
2016
21- /**
22- * @ORM\Column(type="string", length=255)
23- */
17+ #[ORM \Column(type: 'string ' , length: 255 )]
2418 private $ title ;
2519
26- /**
27- * @ORM\Column(type="string", length=255)
28- */
20+ #[ORM \Column(type: 'string ' , length: 255 )]
2921 private $ slug ;
3022
31- /**
32- * @ORM\Column(type="text")
33- */
23+ #[ORM \Column(type: 'text ' )]
3424 private $ content ;
3525
36- /**
37- * @ORM\ManyToMany(targetEntity=Category::class, inversedBy="blogPosts")
38- */
26+ #[ORM \ManyToMany(targetEntity: Category::class, inversedBy: 'blogPosts ' )]
3927 private $ categories ;
4028
41- /**
42- * @ORM\Column(type="datetime")
43- */
29+ #[ORM \Column(type: 'datetime ' )]
4430 private $ createdAt ;
4531
46- /**
47- * @ORM\Column(type="datetime_immutable", nullable=true)
48- */
32+ #[ORM \Column(type: 'datetime_immutable ' , nullable: true )]
4933 private $ publishedAt ;
5034
51- /**
52- * @ORM\ManyToOne(targetEntity=User::class, inversedBy="blogPosts")
53- * @ORM\JoinColumn(nullable=false)
54- */
35+ #[ORM \ManyToOne(targetEntity: User::class, inversedBy: 'blogPosts ' )]
36+ #[ORM \JoinColumn(nullable: false )]
5537 private $ author ;
5638
5739 public function __construct ()
Original file line number Diff line number Diff line change 66use Doctrine \Common \Collections \Collection ;
77use Doctrine \ORM \Mapping as ORM ;
88
9- /**
10- * @ORM\Entity
11- */
9+ #[ORM \Entity]
1210class Category
1311{
14- /**
15- * @ORM\Id
16- * @ORM\GeneratedValue
17- * @ORM\Column(type="integer")
18- */
12+ #[ORM \Id]
13+ #[ORM \GeneratedValue]
14+ #[ORM \Column(type: 'integer ' )]
1915 private $ id ;
2016
21- /**
22- * @ORM\Column(type="string", length=255)
23- */
17+ #[ORM \Column(type: 'string ' , length: 255 )]
2418 private $ name ;
2519
26- /**
27- * @ORM\Column(type="string", length=255)
28- */
20+ #[ORM \Column(type: 'string ' , length: 255 )]
2921 private $ slug ;
3022
31- /**
32- * @ORM\ManyToMany(targetEntity=BlogPost::class, mappedBy="categories")
33- */
23+ #[ORM \ManyToMany(targetEntity: BlogPost::class, mappedBy: 'categories ' )]
3424 private $ blogPosts ;
3525
36- /**
37- * @ORM\Column(type="boolean")
38- */
26+ #[ORM \Column(type: 'boolean ' )]
3927 private bool $ active = false ;
4028
4129 public function __construct ()
Original file line number Diff line number Diff line change 66use Doctrine \Common \Collections \Collection ;
77use Doctrine \ORM \Mapping as ORM ;
88
9- /**
10- * @ORM\Entity
11- * @ORM\Table(name="`user`")
12- */
9+ #[ORM \Entity]
10+ #[ORM \Table(name: '`user` ' )]
1311class User
1412{
15- /**
16- * @ORM\Id
17- * @ORM\GeneratedValue
18- * @ORM\Column(type="integer")
19- */
13+ #[ORM \Id]
14+ #[ORM \GeneratedValue]
15+ #[ORM \Column(type: 'integer ' )]
2016 private $ id ;
2117
22- /**
23- * @ORM\Column(type="string", length=255)
24- */
18+ #[ORM \Column(type: 'string ' , length: 255 )]
2519 private $ name ;
2620
27- /**
28- * @ORM\Column(type="string", length=255)
29- */
21+ #[ORM \Column(type: 'string ' , length: 255 )]
3022 private $ email ;
3123
32- /**
33- * @ORM\OneToMany(targetEntity=BlogPost::class, mappedBy="author", orphanRemoval=true)
34- */
24+ #[ORM \OneToMany(targetEntity: BlogPost::class, mappedBy: 'author ' , orphanRemoval: true )]
3525 private $ blogPosts ;
3626
3727 public function __construct ()
You can’t perform that action at this time.
0 commit comments