Skip to content

Commit

Permalink
Add attributes for BaseTranslation
Browse files Browse the repository at this point in the history
  • Loading branch information
relthyg committed Mar 25, 2024
1 parent 60b844c commit 52cbd82
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Annotation/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
* @Target({"CLASS","PROPERTY"})
*/
#[Attribute(Attribute::TARGET_CLASS)]
#[Attribute(Attribute::TARGET_PROPERTY)]
final class Locale
{
private ?string $primary;
Expand Down
7 changes: 7 additions & 0 deletions src/Entity/BaseTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
/**
* @ORM\MappedSuperclass
*/
#[ORM\MappedSuperclass]
class BaseTranslation
{
/**
Expand All @@ -24,18 +25,24 @@ class BaseTranslation
*
* @ORM\Column(type="integer")
*/
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column(type: "integer")]
protected $id;

/**
* @ORM\Column
*
* @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()
Expand Down

0 comments on commit 52cbd82

Please sign in to comment.