Sulu\Bundle\CategoryBundle\Category\KeywordManager::createTranslation PHP Метод

createTranslation() приватный Метод

Creates a new category translation for a given category and locale.
private createTranslation ( Sulu\Bundle\CategoryBundle\Entity\CategoryInterface $category, $locale ) : Sulu\Bundle\CategoryBundle\Entity\CategoryTranslationInterface
$category Sulu\Bundle\CategoryBundle\Entity\CategoryInterface
$locale
Результат Sulu\Bundle\CategoryBundle\Entity\CategoryTranslationInterface
    private function createTranslation(CategoryInterface $category, $locale)
    {
        $categoryTranslation = $this->categoryTranslationRepository->createNew();
        $categoryTranslation->setLocale($locale);
        $categoryTranslation->setTranslation('');
        $categoryTranslation->setCategory($category);
        $category->addTranslation($categoryTranslation);
        $this->entityManager->persist($categoryTranslation);
        return $categoryTranslation;
    }