src/Kunstmaan/TranslatorBundle/Service/TranslationGroupManager.php
public function getTranslationGroupByKeywordAndDomain($keyword, $domain)
    {
        $translations = $this->findTranslations($keyword, $domain);
        $translationGroup = new TranslationGroup();
        $translationGroup->setDomain($domain);
        $translationGroup->setKeyword($keyword);
        if (empty($translations)) {
            $translationGroup->setId($this->maxId);
            ++$this->maxId;
        } else {
            $translationGroup->setId($translations[0]->getTranslationId());
        }
        $translationGroup->setTranslations($translations);

        return $translationGroup;
    }
public function getTranslationGroupByKeywordAndDomain($keyword, $domain)
    {
        $translations = $this->findTranslations($keyword, $domain);
        $translationGroup = new TranslationGroup();
        $translationGroup->setDomain($domain);
        $translationGroup->setKeyword($keyword);
        if (empty($translations)) {
            $translationGroup->setId($this->maxId);
            ++$this->maxId;
        } else {
            $translationGroup->setId($translations[0]->getTranslationId());
        }
        $translationGroup->setTranslations($translations);

        return $translationGroup;
    }
public function getTranslationGroupByKeywordAndDomain ( $ keyword , $ domain ) { $ translations = $ this -> findTranslations ( $ keyword , $ domain ) ; $ translationGroup = new TranslationGroup ( ) ; $ translationGroup -> setDomain ( $ domain ) ; $ translationGroup -> setKeyword ( $ keyword ) ; if ( empty ( $ translations ) ) { $ translationGroup -> setId ( $ this -> maxId ) ; ++ $ this -> maxId ; } else { $ translationGroup -> setId ( $ translations [ 0 ] -> getTranslationId ( ) ) ; } $ translationGroup -> setTranslations ( $ translations ) ; return $ translationGroup ; }
Returns a TranslationGroup with the given keyword and domain, and fills in the translations
Returns a TranslationGroup with the given keyword and domain and fills in the translations