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:
7676
7777 use Symfony\Component\Validator\Constraints as Assert;
7878
79- /**
80- * @ORM\Entity
81- */
79+ #[ORM\Entity]
8280 #[UniqueEntity('email')]
8381 class User
8482 {
85- /**
86- * @ORM\Column(name="email", type="string", length=255, unique=true)
87- */
83+ #[ORM\Column(name: 'email', type: 'string', length: 255, unique: true)]
8884 #[Assert\Email]
8985 protected $email;
9086 }
@@ -223,27 +219,22 @@ Consider this example:
223219 // src/Entity/Service.php
224220 namespace App\Entity;
225221
222+ use App\Entity\Host;
226223 use Doctrine\ORM\Mapping as ORM;
227224 use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
228225
229- /**
230- * @ORM\Entity
231- */
226+ #[ORM\Entity]
232227 #[UniqueEntity(
233228 fields: ['host', 'port'],
234229 errorPath: 'port',
235230 message: 'This port is already in use on that host.',
236231 )]
237232 class Service
238233 {
239- /**
240- * @ORM\ManyToOne(targetEntity="App\Entity\Host")
241- */
234+ #[ORM\ManyToOne(targetEntity: Host::class)]
242235 public $host;
243236
244- /**
245- * @ORM\Column(type="integer")
246- */
237+ #[ORM\Column(type: 'integer')]
247238 public $port;
248239 }
249240
You can’t perform that action at this time.
0 commit comments