public function configure()
 {
     parent::configure();
     $choices = array(false => 'Não', true => 'Sim');
     unset($this['senha'], $this['areas_afinidade_list'], $this['orientandos_list']);
     //$this->widgetSchema['curso_id'] = new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Curso'), 'add_empty' => true));
     //adiciona um checkbox caso ele for coordenador
     $this->widgetSchema['curso_id'] = new sfWidgetFormInputCheckbox(array(), array('value' => 1));
     $this->validatorSchema['curso_id'] = new sfValidatorInteger(array('required' => false));
     $this->widgetSchema->setLabel('curso_id', 'Coordenador');
 }
 public function save($con = null)
 {
     $sf_guard_user = new sfGuardUser();
     $name = explode(" ", $this->taintedValues['name']);
     $this->getObject()->getSfGuardUser()->setFirstName($name[0]);
     $this->getObject()->getSfGuardUser()->setLastName($name[count($name) - 1]);
     $this->getObject()->getSfGuardUser()->setUsername($this->taintedValues['username']);
     $this->getObject()->getSfGuardUser()->setPassword($this->taintedValues['password']);
     $this->getObject()->getSfGuardUser()->setEmailAddress($this->taintedValues['email']);
     $this->getObject()->getSfGuardUser()->setIsActive();
     parent::save($con);
     return $this->getObject();
 }
Example #3
0
 public function configure()
 {
     parent::configure();
     unset($this['curso_id'], $this['senha'], $this['areas_afinidade_list'], $this['orientandos_list'], $this['curso_id']);
 }