[ Index ] |
|
Code source de SPIP Agora 1.4 |
1 <?php 2 /***************************************************** 3 * This file is part of Agora, web based content management system. 4 * 5 * Agora is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; version 2 of the License. 8 * 9 * Agora is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details (file "COPYING"). 13 * 14 * Copyright © Arnaud Martin, Antoine Pitrou et Philippe Rivière. 15 * List of authors detailed in "copyright_fr.html" file. 16 * E-mail : agora@sig.premier-ministre.gouv.fr 17 * Web site : http://www.agora.gouv.fr 18 *****************************************************/ 19 require_once dirname(__FILE__). "/../document.php"; 20 21 require_once dirname(__FILE__). "/SQLite_functions.php"; 22 23 /** 24 * BD_document_sqlite is an implementation for SQLite of BD_document business class. 25 * @package BD_sqlite 26 * @author Stéphane PETIT <stephane@petit-fr.net> 27 * @access public 28 */ 29 class BD_document_sqlite extends BD_document { 30 // {{{ _fetchData() 31 32 /** 33 * This method is used to fetch result set fields into the object fields 34 * @access private 35 * @param array $row content of fetched data 36 */ 37 38 function _fetchData ($row) { 39 SQLite_CleanName ($row); 40 BD_document::_fetchData($row); 41 } 42 43 // }}} 44 45 // {{{ getAlldocumentIdsForArticleId($articleId) 46 47 /** 48 * This method creates an array of document Ids attached to an article 49 * 50 * param $articleId id of the article which documents must be attached 51 * @return Array wished array of document Ids 52 * @access public 53 */ 54 55 function getAlldocumentIdsForArticleId ($articleId) { 56 $documentIds = array(); 57 $db = &$this->_getDB(); 58 59 if (DB::isError($db)) { 60 return PEAR::raiseError( 61 "[" . get_class( 62 $this). " DB_document : getAlldocumentIdsForArticleId()] " . $db->getMessage(). "", 63 null, 64 null, 65 null, 66 null, 67 null, 68 false); 69 } 70 71 $query 72 = "SELECT docs.id_document AS id_document FROM " . $GLOBALS['table_prefix']. "_documents docs, " . $GLOBALS['table_prefix']. "_documents_articles lien WHERE lien.id_article=$articleId AND lien.id_document=docs.id_document"; 73 74 //echo "<br>$query</br>" ; 75 $result = $db->query($query); 76 77 if (DB::isError($result)) { 78 return PEAR::raiseError( 79 "[" . get_class( 80 $this). " DB_document : getAlldocumentIdsForArticleId()] " . $result->getMessage(). "", 81 null, 82 null, 83 null, 84 null, 85 null, 86 false); 87 } 88 89 while ($row = $result->fetchRow()) { 90 $documentIds[] = $row['id_document']; 91 } 92 93 $result->free(); 94 return $documentIds; 95 } 96 97 // }}} 98 } 99 ?>
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sat Feb 24 14:40:03 2007 | par Balluche grâce à PHPXref 0.7 |