src/Kunstmaan/TranslatorBundle/Service/TranslationGroupManager.php
public function addTranslation(TranslationGroup $translationGroup, $locale, $text, $filename)
    {
        $translation = new \Kunstmaan\TranslatorBundle\Entity\Translation();
        $translation->setLocale($locale);
        $translation->setText($text);
        $translation->setDomain($translationGroup->getDomain());
        $translation->setFile($filename);
        $translation->setKeyword($translationGroup->getKeyword());
        $translation->setCreatedAt(new \DateTime());
        $translation->setUpdatedAt(new \DateTime());
        $translation->setTranslationId($translationGroup->getId());

        $this->translationRepository->persist($translation);
        $this->dbCopy[] = $translation;
    }
public function addTranslation(TranslationGroup $translationGroup, $locale, $text, $filename)
    {
        $translation = new \Kunstmaan\TranslatorBundle\Entity\Translation();
        $translation->setLocale($locale);
        $translation->setText($text);
        $translation->setDomain($translationGroup->getDomain());
        $translation->setFile($filename);
        $translation->setKeyword($translationGroup->getKeyword());
        $translation->setCreatedAt(new \DateTime());
        $translation->setUpdatedAt(new \DateTime());
        $translation->setTranslationId($translationGroup->getId());

        $this->translationRepository->persist($translation);
        $this->dbCopy[] = $translation;
    }
public function addTranslation ( TranslationGroup $ translationGroup , $ locale , $ text , $ filename ) { $ translation = new \ Kunstmaan \ TranslatorBundle \ Entity \ Translation ( ) ; $ translation -> setLocale ( $ locale ) ; $ translation -> setText ( $ text ) ; $ translation -> setDomain ( $ translationGroup -> getDomain ( ) ) ; $ translation -> setFile ( $ filename ) ; $ translation -> setKeyword ( $ translationGroup -> getKeyword ( ) ) ; $ translation -> setCreatedAt ( new \ DateTime ( ) ) ; $ translation -> setUpdatedAt ( new \ DateTime ( ) ) ; $ translation -> setTranslationId ( $ translationGroup -> getId ( ) ) ; $ this -> translationRepository -> persist ( $ translation ) ; $ this -> dbCopy [ ] = $ translation ; }
Checks if the translation exists in the group for this locale, if not, it creates it
Checks if the translation exists in the group for this locale if not it creates it