File tree Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Expand file tree Collapse file tree 1 file changed +5
-8
lines changed Original file line number Diff line number Diff line change @@ -94,30 +94,27 @@ that all have constraints on their properties.
94
94
// src/Entity/BookCollection.php
95
95
namespace App\Entity;
96
96
97
+ use App\Entity\Book;
97
98
use Doctrine\Common\Collections\ArrayCollection;
98
- use Doctrine\Common\Collections\Collection
99
+ use Doctrine\Common\Collections\Collection;
99
100
use Doctrine\ORM\Mapping as ORM;
100
101
use Symfony\Component\Validator\Constraints as Assert;
101
102
102
- /**
103
- * @ORM\Entity
104
- */
103
+ #[ORM\Entity]
105
104
#[Assert\Traverse]
106
105
class BookCollection implements \IteratorAggregate
107
106
{
108
107
/**
109
108
* @var string
110
- *
111
- * @ORM\Column
112
109
*/
110
+ #[ORM\Column]
113
111
#[Assert\NotBlank]
114
112
protected $name = '';
115
113
116
114
/**
117
115
* @var Collection|Book[]
118
- *
119
- * @ORM\ManyToMany(targetEntity="App\Entity\Book")
120
116
*/
117
+ #[ORM\ManyToMany(targetEntity: Book::class)]
121
118
protected $books;
122
119
123
120
// some other properties
You can’t perform that action at this time.
0 commit comments