Exemplo n.º 1
0
	function gravarCurso(Curso $curso){

		if (strlen($curso->getNome())==0){
			throw new Exception('Informe o nome do curso!');
		}else{
			$curso->Xnome = "'".$curso->getNome()."'";
		}

		if (!is_object($curso->getInstituicao())){
			throw new Exception('Instituição é obrigatória');
		}else{
			$curso->Xinstituicao = $curso->getInstituicao()->getId();
		}

		$cursoDAO = new CursoDAO(); 
		$cursoDAO->setBancoDados($this->banco); 
		$cursoDAO->gravaDadosCurso($curso); 
	}