diff --git a/src/Annotation/Locale.php b/src/Annotation/Locale.php index ad3e013..3ae59c9 100644 --- a/src/Annotation/Locale.php +++ b/src/Annotation/Locale.php @@ -18,6 +18,7 @@ * @Target({"CLASS","PROPERTY"}) */ #[Attribute(Attribute::TARGET_CLASS)] +#[Attribute(Attribute::TARGET_PROPERTY)] final class Locale { private ?string $primary; diff --git a/src/Entity/BaseTranslation.php b/src/Entity/BaseTranslation.php index d2cb1b7..d6edbbd 100644 --- a/src/Entity/BaseTranslation.php +++ b/src/Entity/BaseTranslation.php @@ -15,6 +15,7 @@ /** * @ORM\MappedSuperclass */ +#[ORM\MappedSuperclass] class BaseTranslation { /** @@ -24,6 +25,9 @@ class BaseTranslation * * @ORM\Column(type="integer") */ + #[ORM\Id] + #[ORM\GeneratedValue] + #[ORM\Column(type: "integer")] protected $id; /** @@ -31,11 +35,14 @@ class BaseTranslation * * @Polyglot\Locale */ + #[ORM\Column()] + #[Polyglot\Locale] protected $locale; /** * @ORM\JoinColumn(name="entity_id", referencedColumnName="id", nullable=false) */ + #[ORM\JoinColumn(name: "entity_id", referencedColumnName: "id", nullable: false)] protected $entity; public function getLocale()