public function findAllCompetencesInUserCompetencesDQL(Competence $competence) { $query = $this->_em->createQuery('SELECT c FROM CentraleLilleKnowledgeBundle:UserCompetence c JOIN c.competence b WHERE b.id = :competence'); $query->setParameter('competence', $competence->getId()); $results = $query->getResult(); return $results; }
public function createCompetence($name) { if ($name == null) { return false; } else { $competence = new Competence(); $competence->setName($name); $this->em->persist($competence); $this->em->flush(); return true; } }