Exemplo n.º 1
0
 public function persist(Character $character)
 {
     $found = $this->em->getRepository('AppBundle:Character')->find($character->getId());
     // Only persist if it doesnt already exist.
     if (!$found) {
         $this->em->persist($character);
     }
     return true;
 }