Skip to content

Commit 0e020d0

Browse files
committed
minor #15620 Replaced doctrine annotations with attributes (zspine)
This PR was merged into the 5.3 branch. Discussion ---------- Replaced doctrine annotations with attributes <!-- If your pull request fixes a BUG, use the oldest maintained branch that contains the bug (see https://symfony.com/releases for the list of maintained branches). If your pull request documents a NEW FEATURE, use the same Symfony branch where the feature was introduced (and `5.x` for features of unreleased versions). --> Commits ------- aa67a0f Replaced doctrine annotations with attributes
2 parents 8d86ed0 + aa67a0f commit 0e020d0

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

reference/constraints/Traverse.rst

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,30 +94,27 @@ that all have constraints on their properties.
9494
// src/Entity/BookCollection.php
9595
namespace App\Entity;
9696
97+
use App\Entity\Book;
9798
use Doctrine\Common\Collections\ArrayCollection;
98-
use Doctrine\Common\Collections\Collection
99+
use Doctrine\Common\Collections\Collection;
99100
use Doctrine\ORM\Mapping as ORM;
100101
use Symfony\Component\Validator\Constraints as Assert;
101102
102-
/**
103-
* @ORM\Entity
104-
*/
103+
#[ORM\Entity]
105104
#[Assert\Traverse]
106105
class BookCollection implements \IteratorAggregate
107106
{
108107
/**
109108
* @var string
110-
*
111-
* @ORM\Column
112109
*/
110+
#[ORM\Column]
113111
#[Assert\NotBlank]
114112
protected $name = '';
115113
116114
/**
117115
* @var Collection|Book[]
118-
*
119-
* @ORM\ManyToMany(targetEntity="App\Entity\Book")
120116
*/
117+
#[ORM\ManyToMany(targetEntity: Book::class)]
121118
protected $books;
122119
123120
// some other properties

0 commit comments

Comments
 (0)