Open
Conversation
added 8 commits
February 19, 2026 14:54
QuentinHAETTEL
requested changes
Feb 20, 2026
src/Entity/Template.php
Outdated
Comment on lines
297
to
372
| public function getLibelleFromLocale(string $locale): string | ||
| { | ||
| foreach ($this->getTranslations() as $translation) { | ||
| if ($translation->getLocale() === $locale && $translation->getField() === 'libelle') { | ||
| return $translation->getContent(); | ||
| } | ||
| } | ||
|
|
||
| return $this->getLibelle(); | ||
| } | ||
|
|
||
| public function getSubjectFromLocale(string $locale): string | ||
| { | ||
| foreach ($this->getTranslations() as $translation) { | ||
| if ($translation->getLocale() === $locale && $translation->getField() === 'subject') { | ||
| return $translation->getContent(); | ||
| } | ||
| } | ||
|
|
||
| return $this->getSubject(); | ||
| } | ||
|
|
||
| public function getSenderNameFromLocale(string $locale): ?string | ||
| { | ||
| foreach ($this->getTranslations() as $translation) { | ||
| if ($translation->getLocale() === $locale && $translation->getField() === 'senderName') { | ||
| return $translation->getContent(); | ||
| } | ||
| } | ||
|
|
||
| return $this->getSenderName(); | ||
| } | ||
|
|
||
| public function getSenderEmailFromLocale(string $locale): string | ||
| { | ||
| foreach ($this->getTranslations() as $translation) { | ||
| if ($translation->getLocale() === $locale && $translation->getField() === 'senderEmail') { | ||
| return $translation->getContent(); | ||
| } | ||
| } | ||
|
|
||
| return $this->getSenderEmail(); | ||
| } | ||
|
|
||
| public function getTextFromLocale(string $locale): ?string | ||
| { | ||
| foreach ($this->getTranslations() as $translation) { | ||
| if ($translation->getLocale() === $locale && $translation->getField() === 'text') { | ||
| return $translation->getContent(); | ||
| } | ||
| } | ||
|
|
||
| return $this->getText(); | ||
| } | ||
|
|
||
| public function getHtmlFromLocale(string $locale): ?string | ||
| { | ||
| foreach ($this->getTranslations() as $translation) { | ||
| if ($translation->getLocale() === $locale && $translation->getField() === 'html') { | ||
| return $translation->getContent(); | ||
| } | ||
| } | ||
|
|
||
| return $this->getHtml(); | ||
| } | ||
|
|
||
| public function getMjmlFromLocale(string $locale): ?string | ||
| { | ||
| foreach ($this->getTranslations() as $translation) { | ||
| if ($translation->getLocale() === $locale && $translation->getField() === 'mjml') { | ||
| return $translation->getContent(); | ||
| } | ||
| } | ||
|
|
||
| return $this->getMjml(); | ||
| } |
src/Entity/Mail.php
Outdated
| #[ORM\Column(type: 'text', nullable: true)] | ||
| protected ?string $mjml = null; | ||
|
|
||
| #[ORM\Column(type: 'text', nullable: false)] |
Contributor
There was a problem hiding this comment.
En mettant nullable à false, tu dis au SQL que la colonne ne peut pas être null. Sauf qu'on a potentiellement déjà des mails en base de données.
| namespace Lle\HermesBundle\Form; | ||
|
|
||
| use Lle\CruditBundle\Form\Type\CKEditorType; | ||
| use FOS\CKEditorBundle\Form\Type\CKEditorType; |
| public function prepend(ContainerBuilder $container): void | ||
| { | ||
| $hasDoctrineTranslatable = false; | ||
| $hasStofDoctrine_extensions = false; |
Contributor
There was a problem hiding this comment.
hasStofDoctrineExtensions
| } | ||
| } | ||
|
|
||
| if (!$hasDoctrineTranslatable) { |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add translatable email template with Gedmo Translatable