public function addAction()
 {
     $form = new GrupoPesquisaForm($this->getEntityManager());
     $form->get('submit')->setAttribute('label', 'Add');
     $request = $this->getRequest();
     if ($request->isPost()) {
         $grupoPesquisa = new GrupoPesquisa();
         $form->setInputFilter($grupoPesquisa->getInputFilter());
         $form->setData($request->getPost());
         var_dump($form->isValid());
         if ($form->isValid()) {
             $grupoPesquisa->populate($form->getData());
             $professor = $this->getEntityManager()->getRepository('Professor\\Entity\\Professor')->findOneBy(array('idprofessor' => $grupoPesquisa->getPesquisadorresponsavel()));
             $grupoPesquisa->setPesquisadorresponsavel($professor);
             $professor = $this->getEntityManager()->getRepository('Professor\\Entity\\Professor')->findOneBy(array('idprofessor' => $grupoPesquisa->getCoordPesquisa()));
             $grupoPesquisa->setCoordPesquisa($professor);
             $sala = $this->getEntityManager()->getRepository('Sala\\Entity\\Sala')->findOneBy(array('idsala' => $grupoPesquisa->getSalasala()));
             $grupoPesquisa->setSalasala($sala);
             $this->getEntityManager()->persist($grupoPesquisa);
             $this->getEntityManager()->flush();
             return $this->redirect()->toRoute('grupopesquisa');
         }
     }
     return array('form' => $form);
 }
 /**
  * {@inheritDoc}
  */
 public function setCoordPesquisa(\Professor\Entity\Professor $coordPesquisa = NULL)
 {
     $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCoordPesquisa', array($coordPesquisa));
     return parent::setCoordPesquisa($coordPesquisa);
 }