-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement knplabs/doctrine-behaviors - todo
\Knp\DoctrineBehaviors\EventSubscriber\TranslatableEventSubscriber::loadClassMetadata() method is not called, subsriber is - same issue described here KnpLabs/DoctrineBehaviors#729
- Loading branch information
Showing
3 changed files
with
62 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace App\Bundles\AP\Entity; | ||
|
||
use App\Bundles\AP\Repository\MessageTranslationRepository; | ||
use Doctrine\ORM\Mapping as ORM; | ||
use Doctrine\ORM\Mapping\Entity; | ||
use Knp\DoctrineBehaviors\Contract\Entity\TranslationInterface; | ||
use Knp\DoctrineBehaviors\Model\Translatable\TranslationTrait; | ||
|
||
#[Entity(repositoryClass: MessageTranslationRepository::class)] | ||
#[ORM\Table(name: 'ap_message_translation')] | ||
class MessageTranslation implements TranslationInterface | ||
{ | ||
use TranslationTrait; | ||
|
||
#[ORM\Id] | ||
#[ORM\GeneratedValue] | ||
#[ORM\Column] | ||
private ?int $id = null; | ||
|
||
#[ORM\Column] | ||
private ?string $text = null; | ||
|
||
public function getId(): ?int | ||
{ | ||
return $this->id; | ||
} | ||
|
||
public function getText(): ?string | ||
{ | ||
return $this->text; | ||
} | ||
|
||
public function setText(?string $text): void | ||
{ | ||
$this->text = $text; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters