WellCommerce\Bundle\DictionaryBundle\Manager\DictionaryManager::synchronizeDatabaseTranslations PHP Метод

synchronizeDatabaseTranslations() защищенный Метод

protected synchronizeDatabaseTranslations ( array $messages, WellCommerce\Bundle\LocaleBundle\Entity\LocaleInterface $locale )
$messages array
$locale WellCommerce\Bundle\LocaleBundle\Entity\LocaleInterface
    protected function synchronizeDatabaseTranslations(array $messages, LocaleInterface $locale)
    {
        $this->getDoctrineHelper()->truncateTable('WellCommerce\\Bundle\\DictionaryBundle\\Entity\\Dictionary');
        $em = $this->getDoctrineHelper()->getEntityManager();
        foreach ($messages as $identifier => $translation) {
            $dictionary = $this->factory->create();
            $dictionary->setIdentifier($identifier);
            $dictionary->translate($locale->getCode())->setValue($translation);
            $dictionary->mergeNewTranslations();
            $em->persist($dictionary);
        }
    }