File tree Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Expand file tree Collapse file tree 1 file changed +6
-15
lines changed Original file line number Diff line number Diff line change @@ -76,15 +76,11 @@ between all of the rows in your user table:
76
76
77
77
use Symfony\Component\Validator\Constraints as Assert;
78
78
79
- /**
80
- * @ORM\Entity
81
- */
79
+ #[ORM\Entity]
82
80
#[UniqueEntity('email')]
83
81
class User
84
82
{
85
- /**
86
- * @ORM\Column(name="email", type="string", length=255, unique=true)
87
- */
83
+ #[ORM\Column(name: 'email', type: 'string', length: 255, unique: true)]
88
84
#[Assert\Email]
89
85
protected $email;
90
86
}
@@ -223,27 +219,22 @@ Consider this example:
223
219
// src/Entity/Service.php
224
220
namespace App\Entity;
225
221
222
+ use App\Entity\Host;
226
223
use Doctrine\ORM\Mapping as ORM;
227
224
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
228
225
229
- /**
230
- * @ORM\Entity
231
- */
226
+ #[ORM\Entity]
232
227
#[UniqueEntity(
233
228
fields: ['host', 'port'],
234
229
errorPath: 'port',
235
230
message: 'This port is already in use on that host.',
236
231
)]
237
232
class Service
238
233
{
239
- /**
240
- * @ORM\ManyToOne(targetEntity="App\Entity\Host")
241
- */
234
+ #[ORM\ManyToOne(targetEntity: Host::class)]
242
235
public $host;
243
236
244
- /**
245
- * @ORM\Column(type="integer")
246
- */
237
+ #[ORM\Column(type: 'integer')]
247
238
public $port;
248
239
}
249
240
You can’t perform that action at this time.
0 commit comments