コード例 #1
0
ファイル: ShelfDAO.php プロジェクト: Ethennoob/Web
 /**
 *Retorna um array de objetos Shelf
 *Lê a base de dados, e retorna um array de objetos Shelf dos artigos marcados para alerta de acesso
 *@param Shelf shelf objeto shelf que contém o ID do usuário que se quer ter a shelf carregada
 *@returns mixed Array de objetos Shelf
 */
 function getAccessedAlertList($shelf)
 {
     $strsql = "SELECT * FROM user_shelf, articles WHERE user_id = '" . $shelf->getUserID() . "' and user_shelf.pid = articles.pid and user_shelf.access_stat = 1";
     $result = $this->_db->databaseQuery($strsql);
     $shelfList = array();
     for ($i = 0; $i < count($result); $i++) {
         $shelf = new Shelf();
         $article = new Article();
         $article->setPID($result[$i]['PID']);
         $article->setURL($result[$i]['url']);
         $article->setTitle($result[$i]['title']);
         $article->setSerial($result[$i]['serial']);
         $article->setVolume($result[$i]['volume']);
         $article->setNumber($result[$i]['number']);
         $article->setSuppl($result[$i]['suppl']);
         $article->setYear($result[$i]['year']);
         $article->setAuthorXML($result[$i]['authors_xml']);
         $article->setKeywordXML($result[$i]['keywords_xml']);
         $shelf->setPID($result[$i]['PID']);
         $shelf->setCitedStat($result[$i]['cited_stat']);
         $shelf->setAccessStat($result[$i]['access_stat']);
         $shelf->setUserID($result[$i]['user_id']);
         $shelf->setVisible($result[$i]['visible']);
         $shelf->setArticle($article);
         array_push($shelfList, $shelf);
     }
     return $shelfList;
 }