Наследование: extends WellCommerce\Bundle\DoctrineBundle\Entity\AbstractEntity, implements WellCommerce\Bundle\DictionaryBundle\Entity\DictionaryInterface, use trait Knp\DoctrineBehaviors\Model\Timestampable\Timestampable, use trait Knp\DoctrineBehaviors\Model\Translatable\Translatable, use trait Knp\DoctrineBehaviors\Model\Blameable\Blameable
Пример #1
0
 /**
  * Saves translations for particular locale
  *
  * @param string $locale
  * @param array  $data
  */
 protected function saveDatabaseTranslations($locale, array $data)
 {
     $em = $this->getDoctrineHelper()->getEntityManager();
     foreach ($data as $identifier => $value) {
         $dictionary = new Dictionary();
         $dictionary->setIdentifier($identifier);
         $dictionary->translate($locale)->setValue($value);
         $dictionary->mergeNewTranslations();
         $em->persist($dictionary);
     }
     $em->flush();
 }
 public function create() : DictionaryInterface
 {
     $dictionary = new Dictionary();
     $dictionary->setIdentifier('');
     return $dictionary;
 }