Ejemplo n.º 1
0
 public function load(ObjectManager $manager)
 {
     $php = new Language();
     $php->setName('PHP');
     $php->setSlug('php');
     $javascript = new Language();
     $javascript->setName('JavaScript');
     $javascript->setSlug('javascript');
     $manager->persist($php);
     $manager->persist($javascript);
     $manager->flush();
     $this->addReference('php', $php);
     $this->addReference('javascript', $javascript);
 }
Ejemplo n.º 2
0
 /**
  * Set language categories
  * 
  * @param \Protalk\MediaBundle\Entity\Language $language
  */
 private function setLanguageCategories($language)
 {
     $languageCategories = $language->getLanguageCategories();
     foreach ($languageCategories as $index => $category) {
         $languageCategories[$index]->setLanguage($language);
     }
     $language->setLanguageCategories($languageCategories);
 }