function getArticle() { $article = new Article(); if (!$this->domLiteDocument) { die("not domLiteDocument..."); } $temp =& $this->domLiteDocument->getElementsByPath("/SERIAL"); for ($i = 0; $i < $temp->getLength(); $i++) { $item = $temp->item($i); $article->setSerial($this->getNodeText($item, 'TITLEGROUP/TITLE')); } $temp =& $this->domLiteDocument->getElementsByPath("//ISSUEINFO"); for ($i = 0; $i < $temp->getLength(); $i++) { $item = $temp->item($i); $article->setVolume($this->getNodeAttribute($item, 'VOL')); $article->setNumber($this->getNodeAttribute($item, 'NUM')); $article->setSuppl($this->getNodeAttribute($item, 'SUPPL')); $article->setYear($this->getNodeAttribute($item, 'YEAR')); } $temp =& $this->domLiteDocument->getElementsByPath("//ARTICLE"); for ($i = 0; $i < $temp->getLength(); $i++) { $item = $temp->item($i); $article->setPublicationDate($this->getNodeText($item, 'publication-date')); $article->setTitle($this->getNodeXML($item, 'TITLES')); $article->setAuthorXML($this->getNodeXML($item, 'AUTHORS')); $article->setKeywordXML($this->getNodeXML($item, 'KEYWORDS')); $article->setAbstractXML($this->getNodeXML($item, 'ABSTRACT')); } return $article; }
/** * Carrega nos campos da classe os valores que estão armazenados no Banco de Dados * chamada pela getArticle para devolver o objeto artigo para a classe Article * @param integer $ID IDentificador do usuário * @returns integer $sucess 1 em caso de sucesso, 0 em caso de erro */ function loadArticle($p) { $article = new Article(); $article->setPID($p['PID']); $article->setTitle($p['title']); $article->setSerial($p['serial']); $article->setVolume($p['volume']); $article->setNumber($p['number']); $article->setSuppl($p['suppl']); $article->setYear($p['year']); $article->setUrl($p['url']); $article->setAuthorXML($p['authors_xml']); $article->setKeywordXML($p['keywords_xml']); $article->setAbstractXML($p['abstract_xml']); $article->setWpPostID($p['wp_post_id']); $article->setWpURL($p['wp_url']); return $article; }