/** * Método que insere um teste por capítulo no banco de dados. * * @param TesteTopico $teste O teste a ser inserido * * @return bool|int O código do teste inserido ou FALSE em caso de erro * * @throws TesteException */ public function insert(Model $teste) { if (!count($teste->getQuestoes())) { throw new TesteException('Não foram encontradas questões para ' . 'o teste'); } if ($teste instanceof TesteCapitulo) { $fk = "pk_capitulo"; } else { $fk = "pk_conteudo"; } $tIsert = $this->tg->insert(array("{$this->tabela}_pk_usuario" => $teste->getAluno()->getId(), "{$this->tabela}_{$fk}" => $teste->getAlvo()->getId(), "{$this->tabela}_ano" => $teste->getAno())); if (!$tIsert) { throw new TesteException('Não foi possível salvar o teste. ' . 'Tente novamente mais tarde'); } $lastId = $this->tg->lastInsertId(); //Salvando as questões do teste $query = "insert into testes.{$this->tabela}_questao(" . "{$this->tabela}_questao_pk_{$this->tabela}, " . "{$this->tabela}_questao_pk_questao" . ') values '; foreach ($teste->getQuestoes() as $questao) { $query .= "({$lastId}, {$questao->getId()}),"; } $query = substr($query, 0, -1); $prepare = $this->tg->getPDO()->prepare($query); if (!$prepare->execute()) { $this->tg->getPDO()->rollBack(); throw new TesteException('Não foi possível salvar o teste'); } return $lastId; }
/** * Construtor */ public function __construct() { parent::__construct(); $this->nome = ""; $this->grupo = new Grupo(); $this->videoApresentacao = new \GGE\Lib\Filter\Types\Sub\Youtube(); }
public function __construct() { parent::__construct(); $this->hora = new DateTime(); $this->dia = 0; $this->turma = new Turma(); }
/** * Construtor */ public function __construct() { parent::__construct(); $this->titulo = $this->edicao = ""; $this->volume = 0; $this->colecao = new Colecao(); }
/** * Construtor * @param int $id Caso seja informado, inicializa a coordenação com o código */ public function __construct($id = false) { parent::__construct(); if ((int) $id) { $this->setId($id); } }
/** * */ public function __construct() { parent::__construct(); $this->serie = new Serie(); $this->disciplina = new Disciplina(); $this->videoApresentacao = new Youtube(); }
/** * Construtor */ public function __construct($tabela) { parent::__construct(); $this->tabela = $tabela; $this->ano = (int) Loader::data("config", "site", "ano_letivo"); $this->nota = 0.0; }
/** * Construtor */ public function __construct() { parent::__construct(); $this->intercambioPais = ""; $this->instituicao = ""; $this->niveisAceitos = array(1 => "Básico", 2 => "Intermediário", 3 => "Avançado"); }
/** * Construtor */ public function __construct() { parent::__construct(); $this->nome = $this->email = ""; $this->endereco = new Endereco(); $this->telefone = new TelFixo(); $this->dtNascimentoAbertura = new Date(); }
/** * Construtor */ public function __construct() { parent::__construct(); $this->nome = ""; $this->status = false; $this->ano = Loader::data("config", "site", "ano_letivo"); $this->serie = new Serie(); }
public function __construct() { parent::__construct(); $this->nota = false; $this->anexo = new Anexos(); $this->usuario = new Usuario(); $this->dtHora = new DateTime(); }
/** * */ public function __construct() { parent::__construct(); $this->professor = new Professor(); $this->usuarioInsert = new UsuarioInteracao(); $this->dtAula = new Date(); $this->turma = new Turma(); }
/** * Construtor */ public function __construct() { parent::__construct(); $this->tipo = new Tipo(); $this->nome = $this->cor = $this->obs = ""; $this->pontuacao = 0.0; $this->ePositivo = false; }
/** * Construtor */ public function __construct() { parent::__construct(); $this->nome = ""; $this->sequencial = ""; $this->livro = new Livro(); $this->disciplina = new Disciplina(); }
/** * Construtor */ public function __construct() { parent::__construct(); $this->aula = new Aula(); $this->topico = new Topico(); $this->data = new Date(""); $this->status = self::STATUS_NAO_DADO; $this->turma = new Turma(); }
/** * Construtor. */ public function __construct() { parent::__construct(); $this->dataEvento = new Date(); $this->aula = new Aula(); $this->autor = new Usuario(); $this->alvo = new Usuario(); $this->usrInc = new Usuario(); }
/** * */ public function __construct() { parent::__construct(); $this->remetente = new Usuario(); $this->destinatario = new Destinatario(); $this->tipo = new Tipo(); $this->anexos = array(); $this->dtInclusao = new Date(); $this->status = false; }
/** * Construtor. */ public function __construct() { parent::__construct(); $this->aluno = new Aluno(); $this->topico = new Topico(); $this->ano = (int) date('Y'); //Configurando o objeto status $this->itensPermitidos = array("livro", "anexo"); $this->objStatus = new stdClass(); foreach ($this->itensPermitidos as $value) { $this->objStatus->{$value} = array(); } }
/** * Construtor */ public function __construct() { parent::__construct(); $this->defineTipos(); $this->tipo = self::MULTIPLA_ESCOLHA; $this->questao = ""; $this->descricao = ""; $this->tipoInsert = self::SALVA_ARQUIVO; $this->numALternativas = 0; $this->gabarito = ""; $this->dica = ""; $this->explicacao = ""; $this->disciplinas = array(); }
/** * Construtor */ public function __construct() { parent::__construct(); $this->nome = $this->resumo = ""; $this->capitulo = new Capitulo(); $this->sequencial = 0; $this->paginaInicial = 0; $this->paginaFinal = 0; $this->total = 0; $this->paginasTrabalhadas = ""; $this->status = self::STATUS_NAO_DADO; $this->dataStatus = new DateTime(); $this->conteudoDigital = false; }
/** * Método genérico que verifica se existe mensagem para o destinatário especificado(Objeto genérico). * OBS: Os filtros ainda não foram aplicados * @param ModelBase $detinatario O destinatário * @paran FiltrosSistema $filtrosSistema Objeto do sistema de filtros * @return boolean Retorna true caso haja ou false caso não haja */ public function temMensagem(Model $detinatario, FiltrosSistema $filtrosSistema = null) { $tabela = $this->getTabela(); $query = "select* from {$tabela} "; $query .= "inner join " . $tabela . "_destinatarios on mensagem={$tabela}.id "; $query .= "where pk_destinatario=" . $detinatario->getId() . " limit 1"; return (bool) $this->queryStatement($query)->rowCount(); }
/** * Construtor */ public function __construct() { parent::__construct(); }
public function __construct() { parent::__construct(); $this->nome = ""; }
/** * Método que deleta a questão informada do banco de dados. * * @param Questao $questao A questão a ser deletada * * @return bool Retorna TRUE em caso de sucesso ou FALSE em caso de falha * * @throws QuestaoException */ public function delete(Model $questao) { if (!$questao->getId()) { throw new QuestaoException('A questão informada é inválida'); } return $this->tg->delete('pk_questao', $questao->getId()); }
/** * Construtor */ public function __construct() { parent::__construct(); //Definindo os textos para as finalidades $this->definirFinalidades(); //Definindo os dados para os tipos $this->definirNomesTipos(); //Inicializando os objetos básicos $this->usuarioInsert = new UsuarioInteracao(); $this->podeDeletar = true; }
/** * Construtor */ public function __construct() { parent::__construct(); $this->curso = new Curso(); $this->ensino = new Ensino(); }
/** * Construtor * @param int $perfil Defini o perfil inicial do usuário * @param string $tabela Define a tabela especifica do perfil */ public function __construct($perfil = self::PUBLICO, $tabela = "") { parent::__construct(); $this->id = (int) $perfil; $this->tabela = (string) $tabela; }
/** * Construtor */ public function __construct() { parent::__construct(); $this->periodo = new Periodo(); $this->tiposPermitidos = array(self::TIPO_ESTAGIO => "Estágio", self::TIPO_EMPREGO => "Emprego", self::TIPO_VOLUNTARIO => "Trabalho voluntário"); }
/** * Construtor */ public function __construct() { parent::__construct(); $this->status = Status::DESATIVADO; }
public function __construct() { parent::__construct(); $this->nome = $this->email = ""; $this->endereco = new Endereco(); }