Skip to content

Commit 9f1d07f

Browse files
committed
show attributes instead of annotations for maker-bundle
1 parent b21042a commit 9f1d07f

File tree

1 file changed

+13
-17
lines changed

1 file changed

+13
-17
lines changed

doctrine.rst

Lines changed: 13 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -140,27 +140,19 @@ Whoa! You now have a new ``src/Entity/Product.php`` file::
140140
use App\Repository\ProductRepository;
141141
use Doctrine\ORM\Mapping as ORM;
142142

143-
/**
144-
* @ORM\Entity(repositoryClass=ProductRepository::class)
145-
*/
143+
#[ORM\Entity(repositoryClass: ProductRepository::class)]
146144
class Product
147145
{
148-
/**
149-
* @ORM\Id()
150-
* @ORM\GeneratedValue()
151-
* @ORM\Column(type="integer")
152-
*/
153-
private $id;
146+
#[ORM\Id]
147+
#[ORM\GeneratedValue]
148+
#[ORM\Column]
149+
private int $id;
154150

155-
/**
156-
* @ORM\Column(type="string", length=255)
157-
*/
158-
private $name;
151+
#[ORM\Column(length: 255)]
152+
private string $name;
159153

160-
/**
161-
* @ORM\Column(type="integer")
162-
*/
163-
private $price;
154+
#[ORM\Column]
155+
private int $price;
164156

165157
public function getId(): ?int
166158
{
@@ -170,6 +162,10 @@ Whoa! You now have a new ``src/Entity/Product.php`` file::
170162
// ... getter and setter methods
171163
}
172164

165+
.. caution::
166+
167+
Starting in v1.44.0 - MakerBundle only supports entities using Attributes.
168+
173169
.. note::
174170

175171
Confused why the price is an integer? Don't worry: this is just an example.

0 commit comments

Comments
 (0)