Exemplo n.º 1
0
 /**
  * save word
  *
  * @param Word $word
  * @param string $name
  * @param array $results
  */
 public function saveWord($word, $name, $results)
 {
     $em = $this->getEntityManager();
     $word->check("definition");
     $definition = new \FXL\Bundle\LiteracyBundle\Entity\Definition();
     $definition->setContent($this->getResponseAsHtmlList($results));
     $definition->setSource("larousse");
     $word->addDefinition($definition);
     $em->persist($word);
     $em->flush();
 }
Exemplo n.º 2
0
 /**
  * save word
  *
  * @param Word $word
  * @param string $name
  * @param array $results
  */
 public function saveWord($word, $name, $results)
 {
     $em = $this->getEntityManager();
     $word->check("synonym");
     foreach ($results as $synonymName) {
         $synonym = $this->getWord($synonymName);
         $word->addSynonym($synonym);
         $em->persist($synonym);
         $em->flush();
         unset($synonym);
     }
     $em->persist($word);
     $em->flush();
 }
Exemplo n.º 3
0
 /**
  * save word
  *
  * @param Word $word
  * @param string $name
  * @param array $results
  */
 public function saveWord($word, $name, $results)
 {
     $em = $this->getEntityManager();
     $word->check("rhyme");
     foreach ($results as $rhymeName) {
         $rhyme = $this->getWord($rhymeName);
         $word->addRhyme($rhyme);
         $em->persist($rhyme);
         $em->flush();
         unset($rhyme);
     }
     $em->persist($word);
     $em->flush();
 }
Exemplo n.º 4
0
 /**
  * save word
  *
  * @param Word $word
  * @param string $name
  * @param array $results
  */
 public function saveWord($word, $name, $results)
 {
     $em = $this->getEntityManager();
     $word->check("anagram");
     foreach ($results as $anagramName) {
         $anagram = $this->getWord($anagramName);
         $word->addAnagram($anagram);
         $em->persist($anagram);
         $em->flush();
         unset($anagram);
     }
     $em->persist($word);
     $em->flush();
 }