src/Sulu/Bundle/CategoryBundle/Category/CategoryManager.php
private function findOrCreateCategoryTranslation(
        CategoryInterface $category,
        CategoryWrapper $categoryWrapper,
        $locale
    ) {
        $translationEntity = $category->findTranslationByLocale($locale);
        if (!$translationEntity) {
            $translationEntity = $this->categoryTranslationRepository->createNew();
            $translationEntity->setLocale($locale);
            $categoryWrapper->setTranslation($translationEntity);
        }

        return $translationEntity;
    }
private function findOrCreateCategoryTranslation(
        CategoryInterface $category,
        CategoryWrapper $categoryWrapper,
        $locale
    ) {
        $translationEntity = $category->findTranslationByLocale($locale);
        if (!$translationEntity) {
            $translationEntity = $this->categoryTranslationRepository->createNew();
            $translationEntity->setLocale($locale);
            $categoryWrapper->setTranslation($translationEntity);
        }

        return $translationEntity;
    }
private function findOrCreateCategoryTranslation ( CategoryInterface $ category , CategoryWrapper $ categoryWrapper , $ locale ) { $ translationEntity = $ category -> findTranslationByLocale ( $ locale ) ; if ( ! $ translationEntity ) { $ translationEntity = $ this -> categoryTranslationRepository -> createNew ( ) ; $ translationEntity -> setLocale ( $ locale ) ; $ categoryWrapper -> setTranslation ( $ translationEntity ) ; } return $ translationEntity ; }
Returns category-translation or create a new one.

@param CategoryInterface $category
@param CategoryWrapper $categoryWrapper
@param string $locale

@return CategoryTranslationInterface
Returns category - translation or create a new one .