File tree Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Expand file tree Collapse file tree 1 file changed +13
-17
lines changed Original file line number Diff line number Diff line change @@ -140,27 +140,19 @@ Whoa! You now have a new ``src/Entity/Product.php`` file::
140
140
use App\Repository\ProductRepository;
141
141
use Doctrine\ORM\Mapping as ORM;
142
142
143
- /**
144
- * @ORM\Entity(repositoryClass=ProductRepository::class)
145
- */
143
+ #[ORM\Entity(repositoryClass: ProductRepository::class)]
146
144
class Product
147
145
{
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;
154
150
155
- /**
156
- * @ORM\Column(type="string", length=255)
157
- */
158
- private $name;
151
+ #[ORM\Column(length: 255)]
152
+ private string $name;
159
153
160
- /**
161
- * @ORM\Column(type="integer")
162
- */
163
- private $price;
154
+ #[ORM\Column]
155
+ private int $price;
164
156
165
157
public function getId(): ?int
166
158
{
@@ -170,6 +162,10 @@ Whoa! You now have a new ``src/Entity/Product.php`` file::
170
162
// ... getter and setter methods
171
163
}
172
164
165
+ .. caution ::
166
+
167
+ Starting in v1.44.0 - MakerBundle only supports entities using Attributes.
168
+
173
169
.. note ::
174
170
175
171
Confused why the price is an integer? Don't worry: this is just an example.
You can’t perform that action at this time.
0 commit comments