/**
  * @param Conference $conference
  * @return \Doctrine\ORM\QueryBuilder
  * Función para obtener todos los topic de una conferencia
  */
 public function getAllTopicsFromConference(Conference $conference)
 {
     $qb = $this->createQueryBuilder('t');
     $query = $qb->leftJoin('t.conferences', 'c')->where($qb->expr()->eq('c.id', ':id'));
     $query->setParameter('id', $conference->getId());
     return $query;
 }
 /**
  * @Given there are following conferences:
  */
 public function createConferences(TableNode $tableNode)
 {
     $em = $this->getEntityManager();
     foreach ($tableNode->getHash() as $conferenceHash) {
         $conference = new Conference();
         $conference->setName($conferenceHash['name']);
         $conference->setCity($conferenceHash['city']);
         $conference->setDescription($conferenceHash['description']);
         $conference->setCode($conferenceHash['code']);
         $conference->setUrl($conferenceHash['url']);
         $conference->setImage('null');
         $conference->setMimeType('null');
         $conference->setPath('null');
         $conference->setDateStart(new \DateTime($conferenceHash['dateStart']));
         $conference->setDateEnd(new \DateTime($conferenceHash['dateEnd']));
         $conference->setDeadTime(new \DateTime($conferenceHash['deadTime']));
         $conference->setDateNews(new \DateTime($conferenceHash['dateNews']));
         $conference->addTopic($this->findTopic($conferenceHash['topics']));
         $conference->addChairman($this->findUser($conferenceHash['chairmans']));
         $em->persist($conference);
     }
     $em->flush();
 }
 public function conferenceBackendURL(Conference $conference)
 {
     $url = $this->router->generate('sonata_admin_dashboard', [], RouterInterface::ABSOLUTE_URL);
     return str_replace('www', $conference->getCode(), $url);
 }