File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -62,6 +62,7 @@ Let's say you have an existing Doctrine entity `Document` that looks like this:
6262
6363``` php
6464<?php
65+ namespace App\Entity;
6566
6667use Doctrine\ORM\Mapping as ORM;
6768
@@ -106,6 +107,8 @@ This will lead you to something like the following, with some code skipped for b
106107``` php
107108<?php
108109
110+ namespace App\Entity;
111+
109112use Doctrine\Common\Collections\Collection;
110113use Doctrine\Common\Collections\ArrayCollection;
111114use Doctrine\ORM\Mapping as ORM;
@@ -153,9 +156,13 @@ Your code should look similar to this:
153156
154157``` php
155158<?php
159+
160+ namespace App\Entity;
156161
157162use Doctrine\ORM\Mapping as ORM;
158163use Webfactory\Bundle\PolyglotBundle\Entity\BaseTranslation;
164+ use Webfactory\Bundle\PolyglotBundle\Attribute as Polyglot;
165+ use Webfactory\Bundle\PolyglotBundle\TranslatableInterface;
159166
160167#[ORM\Table]
161168#[ORM\UniqueConstraint(columns: ['entity_id', 'locale'])]
@@ -171,7 +178,7 @@ class DocumentTranslation
171178 #[Polyglot\Locale]
172179 private string $locale;
173180
174- #[ORM\ManyToOne(targetEntity: \ Document::class, inversedBy: 'translations')]
181+ #[ORM\ManyToOne(targetEntity: Document::class, inversedBy: 'translations')]
175182 private Document $entity;
176183
177184 public function getLocale(): string
You can’t perform that action at this time.
0 commit comments