/** * Crea uno studente da una riga del db * @param type $row * @return \Studente */ public function creaStudenteDaArray($row) { $studente = new Studente(); $studente->setId($row['studenti_id']); $studente->setNome($row['studenti_nome']); $studente->setCognome($row['studenti_cognome']); $studente->setCitta($row['studenti_citta']); $studente->setCap($row['studenti_cap']); $studente->setVia($row['studenti_via']); $studente->setMatricola($row['studenti_matricola']); $studente->setEmail($row['studenti_email']); $studente->setProvincia($row['studenti_provincia']); $studente->setNumeroCivico($row['studenti_numero_civico']); $studente->setRuolo(User::Studente); $studente->setUsername($row['studenti_username']); $studente->setPassword($row['studenti_password']); if (isset($row['CdL_id'])) { $studente->setCorsoDiLaurea(CorsoDiLaureaFactory::instance()->creaDaArray($row)); } return $studente; }