Beispiel #1
0
 /**
  * Get {@link Scheda} by the identifier 'id' found in the URL.
  * @return Scheda {@link Scheda} instance
  * @throws NotFoundException if the param or {@link Scheda} instance is not found
  */
 public static function getSchedaByGetId()
 {
     $id = null;
     try {
         $id = self::getUrlParam('id');
     } catch (Exception $ex) {
         throw new NotFoundException('Nessuna scheda trovata');
     }
     if (!is_numeric($id)) {
         throw new NotFoundException('Nessuna scheda trovata.');
     }
     $dao = new DAOScheda();
     $scheda = $dao->findById($id);
     if ($scheda === null) {
         throw new NotFoundException('Nessuna scheda trovata.');
     }
     return $scheda;
 }