File tree 1 file changed +8
-1
lines changed
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:
62
62
63
63
``` php
64
64
<?php
65
+ namespace App\Entity;
65
66
66
67
use Doctrine\ORM\Mapping as ORM;
67
68
@@ -106,6 +107,8 @@ This will lead you to something like the following, with some code skipped for b
106
107
``` php
107
108
<?php
108
109
110
+ namespace App\Entity;
111
+
109
112
use Doctrine\Common\Collections\Collection;
110
113
use Doctrine\Common\Collections\ArrayCollection;
111
114
use Doctrine\ORM\Mapping as ORM;
@@ -153,9 +156,13 @@ Your code should look similar to this:
153
156
154
157
``` php
155
158
<?php
159
+
160
+ namespace App\Entity;
156
161
157
162
use Doctrine\ORM\Mapping as ORM;
158
163
use Webfactory\Bundle\PolyglotBundle\Entity\BaseTranslation;
164
+ use Webfactory\Bundle\PolyglotBundle\Attribute as Polyglot;
165
+ use Webfactory\Bundle\PolyglotBundle\TranslatableInterface;
159
166
160
167
#[ORM\Table]
161
168
#[ORM\UniqueConstraint(columns: ['entity_id', 'locale'])]
@@ -171,7 +178,7 @@ class DocumentTranslation
171
178
#[Polyglot\Locale]
172
179
private string $locale;
173
180
174
- #[ORM\ManyToOne(targetEntity: \ Document::class, inversedBy: 'translations')]
181
+ #[ORM\ManyToOne(targetEntity: Document::class, inversedBy: 'translations')]
175
182
private Document $entity;
176
183
177
184
public function getLocale(): string
You can’t perform that action at this time.
0 commit comments