[ Index ]
 

Code source de SPIP Agora 1.4

Accédez au Source d'autres logiciels libresSoutenez Angelica Josefina !

title

Body

[fermer]

/Agora1-4/ecrire/include/cache/ -> article_cache.php (source)

   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  // Base class for Article cache business persistence abstraction.
  20  //
  21  
  22  require_once dirname(__FILE__). "/AgoraCache.php";
  23  
  24  /**
  25   * BD_article_cache is a class for article cache.
  26   * @package    Cache
  27   * @author     Erwan Le Bescond <elebescond@clever-age.com>
  28   * @author  Olivier Mansour  <omansour@clever-age.com>
  29   * @access    public
  30   */
  31  
  32  class article_cache extends AgoraCache {
  33  
  34      // {{{ properties
  35  
  36      // }}}
  37  
  38      // {{{ constructor
  39  
  40      /**
  41       * article_cache constructor.
  42       *
  43       * @access public
  44       */
  45  
  46  	function article_cache ($cacheParams) {
  47          $this->_objectMetier = &recuperer_instance_article(true);
  48          $this->_objectType = 'article';
  49  
  50          $par = get_parent_class($this);
  51          $res = $this->$par($cacheParams);
  52      }
  53  
  54      // }}}
  55  
  56      // {{{ getArticleId()
  57  
  58  	function getArticleId () {
  59          return $this->_objectMetier->getArticleId();
  60      }
  61  
  62      // }}}
  63  
  64      // {{{ setArticleId()
  65  
  66  	function setArticleId ($articleId) {
  67          $this->_objectMetier->setArticleId($articleId);
  68      }
  69  
  70      // }}}
  71  
  72      // {{{ getSurtitre()
  73  
  74  	function getSurtitre () {
  75          return $this->_objectMetier->getSurtitre();
  76      }
  77  
  78      // }}}
  79  
  80      // {{{ setSurtitre()
  81  
  82  	function setSurtitre ($surtitre) {
  83          $this->_objectMetier->setSurtitre($surtitre);
  84      }
  85  
  86      // }}}
  87  
  88      // {{{ getTitre()
  89  
  90  	function getTitre () {
  91          return $this->_objectMetier->getTitre();
  92      }
  93  
  94      // }}}
  95  
  96      // {{{ setTitre()
  97  
  98  	function setTitre ($titre) {
  99          $this->_objectMetier->setTitre($titre);
 100      }
 101  
 102      // }}}
 103  
 104      // {{{ getSoustitre()
 105  
 106  	function getSoustitre () {
 107          return $this->_objectMetier->getSoustitre();
 108      }
 109  
 110      // }}}
 111  
 112      // {{{ setSoustitre()
 113  
 114  	function setSoustitre ($soustitre) {
 115          $this->_objectMetier->setSoustitre($soustitre);
 116      }
 117  
 118      // }}}
 119  
 120      // {{{ getRubriqueId
 121  
 122  	function getRubriqueId () {
 123          return $this->_objectMetier->getRubriqueId();
 124      }
 125  
 126      // }}}
 127  
 128      // {{{ setRubriqueId()
 129  
 130  	function setRubriqueId ($rubriqueId) {
 131          $this->_objectMetier->setRubriqueId($rubriqueId);
 132      }
 133  
 134      // }}}
 135  
 136      // {{{ getDescriptif()
 137  
 138  	function getDescriptif () {
 139          return $this->_objectMetier->getDescriptif();
 140      }
 141  
 142      // }}}
 143  
 144      // {{{ setDescriptif()
 145  
 146  	function setDescriptif ($descriptif) {
 147          $this->_objectMetier->setDescriptif($descriptif);
 148      }
 149  
 150      // }}}
 151  
 152      // {{{ getChapo()
 153  
 154  	function getChapo () {
 155          return $this->_objectMetier->getChapo();
 156      }
 157  
 158      // }}}
 159  
 160      // {{{ setChapo()
 161  
 162  	function setChapo ($chapo) {
 163          $this->_objectMetier->setChapo($chapo);
 164      }
 165  
 166      // }}}
 167  
 168      // {{{ getTexte()
 169  
 170  	function getTexte () {
 171          return $this->_objectMetier->getTexte();
 172      }
 173  
 174      // }}}
 175  
 176      // {{{ setTexte()
 177  
 178  	function setTexte ($texte) {
 179          //var_dump($this->_objectMetier);
 180          $this->_objectMetier->setTexte($texte);
 181      }
 182  
 183      // }}}
 184  
 185      // {{{ getPs()
 186  
 187  	function getPs () {
 188          return $this->_objectMetier->getPs();
 189      }
 190  
 191      // }}}
 192  
 193      // {{{ setPs()
 194  
 195  	function setPs ($ps) {
 196          $this->_objectMetier->setPs($ps);
 197      }
 198  
 199      // }}}
 200  
 201      // {{{ getDate()
 202  
 203  	function getDate () {
 204          return $this->_objectMetier->getDate();
 205      }
 206  
 207      // }}}
 208  
 209      // {{{ setDate()
 210  
 211  	function setDate ($date) {
 212          $this->_objectMetier->setDate($date);
 213      }
 214  
 215      // }}}
 216  
 217      // {{{ getStatut()
 218  
 219  	function getStatut () {
 220          return $this->_objectMetier->getStatut();
 221      }
 222  
 223      // }}}
 224  
 225      // {{{ setStatut()
 226  
 227  	function setStatut ($statut) {
 228          $this->_objectMetier->setStatut($statut);
 229      }
 230  
 231      // }}}
 232  
 233      // {{{ getSecteurId()
 234  
 235  	function getSecteurId () {
 236          return $this->_objectMetier->getSecteurId();
 237      }
 238  
 239      // }}}
 240  
 241      // {{{ setSecteurId()
 242  
 243  	function setSecteurId ($secteurId) {
 244          $this->_objectMetier->setSecteurId($secteurId);
 245      }
 246  
 247      // }}}
 248  
 249      // {{{ getMajDate()
 250  
 251  	function getMajDate () {
 252          return $this->_objectMetier->getMajDate();
 253      }
 254  
 255      // }}}
 256  
 257      // {{{ setMajDate()
 258  
 259  	function setMajDate ($majDate) {
 260          $this->_objectMetier->setMajDate($majDate);
 261      }
 262  
 263      // }}}
 264  
 265      // {{{ getExport()
 266  
 267  	function getExport () {
 268          return $this->_objectMetier->getExport();
 269      }
 270  
 271      // }}}
 272  
 273      // {{{ setExport()
 274  
 275  	function setExport ($export) {
 276          $this->_objectMetier->setExport($export);
 277      }
 278  
 279      // }}}
 280  
 281      // {{{ getRedactionDate()
 282  
 283  	function getRedactionDate () {
 284          return $this->_objectMetier->getRedactionDate();
 285      }
 286  
 287      // }}}
 288  
 289      // {{{ setRedactionDate()
 290  
 291  	function setRedactionDate ($redactionDate) {
 292          $this->_objectMetier->setRedactionDate($redactionDate);
 293      }
 294  
 295      // }}}
 296  
 297      // {{{ getVisites()
 298  
 299  	function getVisites () {
 300          return $this->_objectMetier->getVisites();
 301      }
 302  
 303      // }}}
 304  
 305      // {{{ setVisistes()
 306  
 307  	function setVisites ($visites) {
 308          $this->_objectMetier->setVisites($visites);
 309      }
 310  
 311      // }}}
 312  
 313      // {{{ getReferers()
 314  
 315  	function getReferers () {
 316          return $this->_objectMetier->getReferers();
 317      }
 318  
 319      // }}}
 320  
 321      // {{{ setReferers()
 322  
 323  	function setReferers ($referers) {
 324          $this->_objectMetier->setReferers($referers);
 325      }
 326  
 327      // }}}
 328  
 329      // {{{ getPopularite()
 330  
 331  	function getPopularite () {
 332          return $this->_objectMetier->getPopularite();
 333      }
 334  
 335      // }}}
 336  
 337      // {{{ setPopularite()
 338  
 339  	function setPopularite ($popularite) {
 340          $this->_objectMetier->setPopularite($popularite);
 341      }
 342  
 343      // }}}
 344  
 345      // {{{ getAccpeterForum()
 346  
 347  	function getAccepterForum () {
 348          return $this->_objectMetier->getAccepterForum();
 349      }
 350  
 351      // }}}
 352  
 353      // {{{ setAccepterForum()
 354  
 355  	function setAccepterForum ($accepterForum) {
 356          $this->_objectMetier->setAccepterForum($accepterForum);
 357      }
 358  
 359      // }}}
 360  
 361      // {{{ getAuteurModif()
 362  
 363  	function getAuteurModif () {
 364          return $this->_objectMetier->getAuteurModif();
 365      }
 366  
 367      // }}}
 368  
 369      // {{{ setAuteurModif()
 370  
 371  	function setAuteurModif ($auteurModif) {
 372          $this->_objectMetier->setAuteurModif($auteurModif);
 373      }
 374  
 375      // }}}
 376  
 377      // {{{ getModificationDate()
 378  
 379  	function getModificationDate () {
 380          return $this->_objectMetier->getModificationDate();
 381      }
 382  
 383      // }}}
 384  
 385      // {{{ setModificationDate()
 386  
 387  	function setModificationDate ($modificationDate) {
 388          $this->_objectMetier->setModificationDate($modificationDate);
 389      }
 390  
 391      // }}}
 392  
 393      // {{{ getExtra()
 394  
 395  	function getExtra () {
 396          return $this->_objectMetier->getExtra();
 397      }
 398  
 399      // }}}
 400  
 401      // {{{ setExtra()
 402  
 403  	function setExtra ($extra) {
 404          $this->_objectMetier->setExtra($extra);
 405      }
 406  
 407      // }}}
 408  
 409      // {{{ getLang()
 410  
 411      /**
 412       * Returns the lang fields
 413       * @return  String
 414       * @access  public
 415       */
 416  
 417  	function getLang () {
 418          return $this->_objectMetier->getLang();
 419      }
 420  
 421      // }}}
 422  
 423      // {{{ setLang()
 424  
 425      /**
 426       * Sets the lang fields
 427       * @param   String
 428       * @access  public
 429       */
 430  
 431  	function setLang ($lang) {
 432          $this->_objectMetier->setLang($lang);
 433      }
 434  
 435      // }}}
 436  
 437      // {{{ getLangChoisie()
 438  
 439      /**
 440       * get Lang functions activation.
 441       * @var     String
 442       * @access  private
 443       */
 444  
 445  	function getLangChoisie () {
 446          return $this->_objectMetier->getLangChoisie();
 447      }
 448  
 449      // }}}
 450  
 451      // {{{ setLangChoisie()
 452  
 453      /**
 454       * Set Lang functions activation.
 455       * @var     String
 456       * @access  private
 457       */
 458  
 459  	function setLangChoisie ($langChoisie) {
 460          $this->_objectMetier->setLangChoisie($langChoisie);
 461      }
 462  
 463      // }}}
 464  
 465      // {{{ getTradId()
 466  
 467      /**
 468       * get Trad id.
 469       * @var     int
 470       * @access  private
 471       */
 472  
 473  	function getTradId () {
 474          return $this->_objectMetier->getTradId();
 475      }
 476  
 477      // }}}
 478  
 479      // {{{ setTradId()
 480  
 481      /**
 482       * Set Trad Id.
 483       * @var     int
 484       * @access  private
 485       */
 486  
 487  	function setTradId ($tradId) {
 488          $this->_objectMetier->setTradId($tradId);
 489      }
 490  
 491      // }}}
 492  
 493      // {{{ getNomSite()
 494  
 495      /**
 496       * get Site Name.
 497       * @var     String
 498       * @access  private
 499       */
 500  
 501  	function getNomSite () {
 502          return $this->_objectMetier->getNomSite();
 503      }
 504  
 505      // }}}
 506  
 507      // {{{ setNomSite()
 508  
 509      /**
 510       * Set Site Name.
 511       * @var     String
 512       * @access  private
 513       */
 514  
 515  	function setNomSite ($nomSite) {
 516          $this->_objectMetier->setNomSite($nomSite);
 517      }
 518  
 519      // }}}
 520  
 521      // {{{ getUrlSite()
 522  
 523      /**
 524       * get Site Url.
 525       * @var     String
 526       * @access  private
 527       */
 528  
 529  	function getUrlSite () {
 530          return $this->_objectMetier->getUrlSite();
 531      }
 532  
 533      // }}}
 534  
 535      // {{{ setUrlSite()
 536  
 537      /**
 538       * Set Site Url.
 539       * @var     String
 540       * @access  private
 541       */
 542  
 543  	function setUrlSite ($urlSite) {
 544          $this->_objectMetier->setUrlSite($urlSite);
 545      }
 546  
 547      // }}}
 548  
 549      // {{{ getVersionId
 550      /**
 551       * Get the version Id
 552       * 
 553       */
 554  
 555  	function getVersionId () {
 556          return $this->_objectMetier->getVersionId();
 557      }
 558  
 559      // }}}
 560  
 561      // {{{ setVersionId
 562  
 563      /**
 564       * Set the Version Id
 565       */
 566  
 567  	function setVersionId ($versionId) {
 568          $this->_objectMetier->setVersionId($versionId);
 569      }
 570  
 571      // }}}
 572  
 573      // {{{ getActiverHistorique()
 574  
 575  	function getActiverHistorique () {
 576          return $this->_objectMetier->getActiverHistorique();
 577      }
 578  
 579      // }}}
 580  
 581      // {{{ setActiverHistorique()
 582  
 583  	function setActiverHistorique ($activerHistorique) {
 584          $this->_objectMetier->setActiverHistorique($activerHistorique);
 585      }
 586  
 587      // }}}
 588  
 589      // {{{ create()
 590  
 591      /**
 592       * This method is used to create a new article in the database
 593       * @access public
 594       */
 595  
 596  	function create () {
 597          $this->flushBothCache();
 598          return $this->_objectMetier->create();
 599      }
 600  
 601      // }}}
 602  
 603      // {{{ update()
 604  
 605      /**
 606       * This method is used to update this article in the database
 607       * @access public
 608       */
 609  
 610  	function update () {
 611          $this->flushBothCache();
 612          return $this->_objectMetier->update();
 613      }
 614  
 615      // }}}
 616  
 617      // {{{ load()
 618  
 619      /**
 620       * This method is used to load an article from the database
 621       * @access  public
 622       * @param   int $idArticle id of article to load
 623       */
 624  
 625  	function load ($idArticle) {
 626          $signature = $this->_cache->generateID('load' . $idArticle);
 627          // $signature = 'load'.$idArticle;
 628          $this->_objectId = $idArticle;
 629  
 630          if ($this->cacheExist($signature)) {
 631              //echo 'LE CACHE EXISTE<br /><br />';
 632              $this->_objectMetier = $this->loadCache($signature);
 633              return $this->_objectMetier;
 634          }
 635          else {
 636              //echo 'LE CACHE N\'EXISTE PAS<br /><br />';
 637              $result = $this->_objectMetier->load($idArticle);
 638  
 639              if (!PEAR::isError($result)) {
 640                  $this->saveCache($signature, $this->_objectMetier);
 641              }
 642              return $result;
 643          }
 644      }
 645  
 646      // }}}
 647  
 648      // {{{ loadLightWeight()
 649  
 650      /**
 651       * This method is used to load an article from the database
 652       * selecting only small size fields from the DB
 653       * @access  public
 654       * @param   int $idArticle id of article to load
 655       * ne retourne rien 
 656       */
 657  	function loadLightWeight ($idArticle) {
 658          $signature = $this->_cache->generateID('loadLightWeight' . $idArticle);
 659          $this->_objectId = $idArticle;
 660  
 661          if ($this->cacheExist($signature)) {
 662              $this->_objectMetier = $this->loadCache($signature);
 663          //return $this->_objectMetier;
 664          }
 665          else {
 666              $result = $this->_objectMetier->loadLightWeight($idArticle);
 667              if (!PEAR::isError($result)) {
 668                  $this->saveCache($signature, $this->_objectMetier);
 669              }
 670          //return $result;
 671          }
 672  
 673      //return $this->_objectMetier->loadLightWeight($idArticle);
 674      }
 675  
 676      // }}}
 677  
 678      // {{{ loadLightWeightIfStatut($idArticle, $statut)
 679  
 680      /**
 681       * This method is used to load an article from the database
 682       * selecting only small size fields from the DB
 683       * @access  public
 684       * @param   int $idArticle id of article to load
 685       * @param   String $statut of article to load
 686       */
 687  	function loadLightWeightIfStatut ($idArticle, $statut) {
 688          $signature = $this->_cache->generateID('loadLightWeightIfStatut' . $idArticle . $statut);
 689          //$signature = 'loadLightWeightIfStatut'.$idArticle.$statut;
 690          $this->_objectId = $idArticle;
 691  
 692          if ($this->cacheExist($signature)) {
 693              return $this->loadCache($signature);
 694          }
 695          else {
 696              $result = $this->_objectMetier->loadLightWeightIfStatut($idArticle, $statut);
 697  
 698              if (!PEAR::isError($result)) {
 699                  $this->saveCache($signature, $result);
 700              }
 701              return $result;
 702          }
 703  
 704      //return $this->_objectMetier->loadLightWeightIfStatut($idArticle, $statut);
 705  
 706      }
 707  
 708      // }}}
 709  
 710      // {{{ delete()
 711  
 712      /**
 713       * This method is used to delete an article from the database
 714       * @access  public
 715       * @param   int $idArticle id of article to delete
 716       */
 717  
 718  	function delete ($idArticle) {
 719          $this->flushBothCache();
 720          return $this->_objectMetier->delete($idArticle);
 721      }
 722  
 723      // }}}
 724  
 725      // {{{ unlock()
 726  
 727      /**
 728       * This method unlock an Article
 729       * @access  public
 730       * @param   int $idArticle id of article to unlock
 731       */
 732  	function unlock ($idArticle, $connect_id_auteur) {
 733          return $this->_objectMetier->unlock($idArticle, $connect_id_auteur);
 734      }
 735  
 736      // }}}
 737  
 738      // {{{ _fetchData()
 739  
 740      /**
 741       * This method is used to fetch result set fields into the object fields
 742       * @access  private
 743       * @param   int $idArticle id of article to load
 744       */
 745  
 746  	function _fetchData ($row) {
 747          return $this->_objectMetier->_fetchData($row);
 748      }
 749  
 750      // }}}
 751  
 752      // {{{ _fetchLightWeightData()
 753  
 754      /**
 755       * This method is used to fetch result set fields into the object fields
 756       * used with loadLightWeight
 757       * @access  private
 758       * @param   int $idArticle id of article to load
 759       * @see     loadLightWeight($idArticle)
 760       */
 761  	function _fetchLightWeightData ($row) {
 762          return $this->_objectMetier->_fetchLightWeightData($row);
 763      }
 764  
 765      // }}}
 766  
 767      // {{{ deleteMajDate($majDate)
 768  
 769      /**
 770       * This method is used to delete all articles former to mydate
 771       * @access  public
 772       */
 773  
 774  	function deleteMajDate ($mydate) {
 775          $this->flushBothCache();
 776          $this->_objectMetier->deleteMajDate($mydate);
 777      }
 778  
 779      // {{{ deleteArticleForStatut($statut, $maj)
 780  
 781      /**
 782       * This method is used to delete all deleted articles
 783       * @access  public
 784       */
 785  
 786  	function deleteArticleForStatut ($statut, $maj) {
 787          $this->flushBothCache();
 788          $this->_objectMetier->deleteArticleForStatut($statut, $maj);
 789      }
 790  
 791      // {{{ deleteAuteurs()
 792  
 793      /**
 794       * This method is used to delete all authors attached to this article
 795       * @access  public
 796       */
 797  
 798  	function deleteAuteurs () {
 799          $this->flushAllCache();
 800          $this->_objectMetier->deleteAuteurs();
 801      }
 802  
 803      // }}}
 804  
 805      // {{{ deleteAuteur()
 806  
 807      /**
 808      * This method is used to delete a given author attached to this article
 809      * @param   int $authorId author to delete
 810      * @access  public
 811      */
 812  	function deleteAuteur ($authorId) {
 813          $this->flushAllCache();
 814          $this->_objectMetier->deleteAuteur($authorId);
 815      }
 816  
 817      // }}}
 818  
 819      // {{{ deleteAllAuteurIdsExceptArticleIds($articles)
 820  
 821      /**
 822      * This method is used to delete authors not attached to a list of articleIds
 823      * @param   int list of rubriqueIds
 824      * @access  public
 825      */
 826  	function deleteAllAuteurIdsExceptArticleIds ($articles) {
 827          $this->flushAllCache();
 828          $this->_objectMetier->deleteAllAuteurIdsExceptArticleIds($articles);
 829      }
 830  
 831      // }}}
 832  
 833      // {{{ deleteAllAuteurIdsExceptAuteurIds($auteurs)
 834  
 835  	function deleteAllAuteurIdsExceptAuteurIds ($auteurs) {
 836          $this->flushAllCache();
 837          $this->_objectMetier->deleteAllAuteurIdsExceptAuteurIds($auteurs);
 838      }
 839  
 840      // }}}
 841  
 842      // {{{ addAuteur()
 843  
 844      /**
 845      * This method is used to attach an author to this article
 846      * @param   int $authorId autor to attach
 847      * @access  public
 848      */
 849  	function addAuteur ($auteurId) {
 850          $this->flushAllCache();
 851          return $this->_objectMetier->addAuteur($auteurId);
 852      }
 853  
 854      // }}}
 855  
 856      // {{{ isAuthor()
 857  
 858      /**
 859      * This method determines whether or not a given author is an author
 860      * of this article
 861      * @param   int $auteurId author to check
 862      * @return  boolean
 863      * @access  public
 864      */
 865  	function isAuthor ($auteurId) {
 866          return $this->_objectMetier->isAuthor($auteurId);
 867      }
 868  
 869      // }}}
 870  
 871      // {{{ getRubriqueIdsByStatus()
 872  
 873      /**
 874      * This method is used to get all "rubrique" containing published articles
 875      * @param   String  status to look for
 876      * @param   boolean look for postdated articles ?
 877      * @return  mixed   result array of IDs or PEAR::Error object
 878      * @access  public
 879      */
 880  	function getRubriqueIdsByStatus ($statut, $postDated) {
 881          return $this->_objectMetier->getRubriqueIdsByStatus($statut, $postDated);
 882      }
 883  
 884      // }}}
 885  
 886      // {{{ getRubriqueIds()
 887  
 888      /**
 889      * This method is used to get all "rubrique" containing published articles
 890      * @access  public
 891      */
 892  	function getRubriqueIds () {
 893          return $this->_objectMetier->getRubriqueIds();
 894      }
 895  
 896      // }}}
 897  
 898      // {{{ getMaxDateByRubriqueAndStatus()
 899  
 900      /**
 901       * This method is used to the latest date of a published article for a given rubrique
 902       * with a given status and a flag to determine whether or not to handle postdated articles
 903       * @param   int     $rubriqueId
 904       * @param   String  status to look for
 905       * @param   boolean look for postdated articles ?
 906       * @return  mixed   Date or PEAR::Error object
 907       * @access  public
 908       */
 909  	function getMaxDateByRubriqueAndStatus ($rubriqueId, $statut, $postDated) {
 910          return $this->_objectMetier->getMaxDateByRubriqueAndStatus($rubriqueId, $statut, $postDated);
 911      }
 912  
 913      // }}}
 914  
 915      // {{{ getRecentArticleIds()
 916  
 917      /**
 918       * This method returns an array of article ids, representing the 10 most recent ones
 919       *
 920       * @return  Array   containing the wished IDs
 921       * @access  public
 922       */
 923  
 924      function &getRecentArticleIds () {
 925          return $this->_objectMetier->getRecentArticleIds();
 926      }
 927  
 928      // }}}
 929  
 930      // {{{ updateSecteursForRubriques()
 931  
 932      /**
 933       * This method is used to update the sector racttached to different articles
 934       * @param   int     id sector
 935       * @param   array   Rubriques id list
 936       * @return  mixed   nothing or PEAR::Error object
 937       * @access  public
 938       */
 939  	function updateSecteursForRubriques ($secteurId, $listRubriques) {
 940          $this->flushAllCache();
 941          $this->_objectMetier->updateSecteursForRubriques($secteurId, $listRubriques);
 942      }
 943  
 944      // }}}
 945  
 946      // {{{ updateTradIdForTradId($idTradOld, $idTradNew)
 947  
 948      /**
 949       * This method is used to update the sector racttached to different articles
 950       * @param   int     id sector
 951       * @param   array   Rubriques id list
 952       * @return  mixed   nothing or PEAR::Error object
 953       * @access  public
 954       */
 955  	function updateTradIdForTradId ($idTradOld, $idTradNew) {
 956          $this->flushAllCache();
 957          $this->_objectMetier->updateTradIdForTradId($idTradOld, $idTradNew);
 958      }
 959  
 960      // }}}
 961  
 962      // {{{ updateAccepterForum()
 963  
 964      /**
 965       * This method is used to update the forum acceptation flag for an article subset
 966       * @param   String  update type
 967       * @param   boolean accept forum ?
 968       * @return  mixed   void or PEAR::Error object
 969       * @access  public
 970       */
 971  	function updateAccepterForum ($updateType, $acceptForum) {
 972          $this->flushAllCache();
 973          $this->_objectMetier->updateAccepterForum($updateType, $acceptForum);
 974      }
 975  
 976      // }}}
 977  
 978      // {{{ isPostDated()
 979  
 980      /**
 981       * This method tests whether or not this article is postdated.
 982       * @return  mixed   boolean or PEAR::Error object
 983       * @access  public
 984       */
 985  	function isPostDated () {
 986          return $this->_objectMetier->isPostDated();
 987      }
 988  
 989      // }}}
 990  
 991      // {{{ hasLastModified()
 992  
 993      /**
 994       * This method tests whether a given author has last modified this article
 995       * @return  mixed   boolean or PEAR::Error object
 996       * @access  public
 997       */
 998  	function hasLastModified ($auteurId) {
 999          return $this->_objectMetier->hasLastModified($auteurId);
1000      }
1001  
1002      // }}}
1003  
1004      // {{{ getMaxDateHeure($id_rubrique,$statut, $post_dates)
1005  
1006  	function getMaxDateHeure ($id_rubrique, $statut, $post_dates = 'non') {
1007          return $this->_objectMetier->getMaxDateHeure($id_rubrique, $statut, $post_dates);
1008      }
1009  
1010      // }}}
1011  
1012      // {{{ getLastModifiedUserName()
1013  
1014      /**
1015       * This method returns the last contributor of this article name
1016       * @return  mixed   String or PEAR::Error object
1017       * @access  public
1018       */
1019  	function getLastModifiedUserName () {
1020          return $this->_objectMetier->getLastModifiedUserName();
1021      }
1022  
1023      // }}}
1024  
1025      // {{{ whenWasModified
1026  
1027  	function whenWasModified () {
1028          return $this->_objectMetier->whenWasModified();
1029      }
1030  
1031      // }}}
1032  
1033      // {{{ howManyWritten()
1034  
1035      /**
1036       * This method returns the number of article written by a given author
1037       * @return  int
1038       * @access  public
1039       */
1040  	function howManyWritten ($authorId, $allowedStatus = '') {
1041          return $this->_objectMetier->howManyWritten($authorId, $allowedStatus);
1042      }
1043  
1044      // }}}
1045  
1046      // {{{ howManyPublished()
1047  
1048      /**
1049       * This method returns the number of published articles
1050       * @return  int
1051       * @access  public
1052       */
1053  	function howManyPublished () {
1054          return $this->_objectMetier->howManyPublished();
1055      }
1056  
1057      // }}}
1058  
1059      // {{{ howManyProposed()
1060  
1061      /**
1062       * This method returns the number of proposed articles
1063       * @return  int
1064       * @access  public
1065       */
1066  	function howManyProposed () {
1067          return $this->_objectMetier->howManyProposed();
1068      }
1069  
1070      // }}}
1071  
1072      // {{{ hasDocument()
1073  
1074      /**
1075       * This method tests whether or not this article contains any document
1076       * @return  boolean
1077       * @access  public
1078       */
1079  	function hasDocument ($documentId) {
1080          return $this->_objectMetier->hasDocument($documentId);
1081      }
1082  
1083      // }}}
1084  
1085      // {{{ getToday()
1086  
1087      /**
1088       * Returns an array of Article representing
1089       * the current day published articles.
1090       *
1091       * This method is abstract and will be implemented
1092       * in a future version, when the data model has been
1093       * updated.
1094       *
1095       * @return Array of Article
1096       * @param $month
1097       * @param $year
1098       * @access public
1099       */
1100  
1101      function &getToday ($month, $year) {
1102          return $this->_objectMetier->getToday($month, $year);
1103      }
1104  
1105      // }}}
1106  
1107      // {{{ getPublishedAndPopular()
1108  
1109      /**
1110       * This method returns an array of Article objects that are published
1111       * and that have already been visited
1112       *
1113       * @return  Array   wished array of articles
1114       * @access  public
1115       */
1116  
1117      function &getPublishedAndPopular () {
1118          return $this->_objectMetier->getPublishedAndPopular();
1119      }
1120  
1121      // }}}
1122  
1123      // {{{ getRecentPublishedAndPopularButNotSeen()
1124  
1125      /**
1126       * This method returns an array of Article objects that are published
1127       * and that have already been visited
1128       *
1129       * @param   String  $recentIds comma separated ids of recent articles
1130       * @param   String  $seenIds comma separated ids of seen articles
1131       * @return  Array   wished array of articles
1132       * @access  public
1133       */
1134  
1135      function &getRecentPublishedAndPopularButNotSeen ($recentIds, $seenIds) {
1136          return $this->_objectMetier->getRecentPublishedAndPopularButNotSeen($recentIds, $seenIds);
1137      }
1138  
1139      // }}}
1140  
1141      // {{{ getPublishedAndPopularFromBeginning()
1142  
1143      /**
1144       * This method returns an array of Article objects
1145       *
1146       * @return  Array   wished array of articles
1147       * @access  public
1148       */
1149  
1150      function &getPublishedAndPopularFromBeginning () {
1151          return $this->_objectMetier->getPublishedAndPopularFromBeginning();
1152      }
1153  
1154      // }}}
1155  
1156      // {{{ getOpened()
1157  
1158      /**
1159       * Returns an array of Article representing
1160       * the currently opened articles for a given author
1161       *
1162       * This method is abstract and will be implemented
1163       * in a future version, when the data model has been
1164       * updated.
1165       *
1166       * @return Array of Article
1167       * @param int $authorId
1168       * @access public
1169       */
1170  
1171      function &getOpened ($authorId) {
1172          return $this->_objectMetier->getOpened($authorId);
1173      }
1174  
1175      // }}}
1176  
1177      // {{{ getExtract()
1178  
1179      /**
1180       * Returns an extract of this article instance
1181       *
1182       * @return String representing the extract of the article
1183       * @access public
1184       */
1185  
1186  	function getExtract () {
1187          return $this->_objectMetier->getExtract();
1188      }
1189  
1190      // }}}
1191  
1192      // {{{ updateVisites())
1193  
1194      /**
1195       * Updates a set of articles visites
1196       *
1197       * @param array $articleIds containing all article IDs of articles to update
1198       * @param int $visites representing the new value for visites
1199       * @return mixed DB::Error if an error occured, nothin otherwise
1200       * @access public
1201       */
1202  
1203  	function updateVisites ($articleIds, $visits) {
1204          return $this->_objectMetier->updateVisites($articleIds, $visits);
1205      }
1206  
1207      // }}}
1208  
1209      // {{{ computePopularity())
1210  
1211      /**
1212       * Updates all articles to compute new popularity value
1213       *
1214       * @return mixed DB::Error if an error occured, nothin otherwise
1215       * @access public
1216       */
1217  
1218      //Désolé pour le code, mais c'est toujours parail : on essaye de garder
1219      //au maximum le code original...
1220  
1221  	function computePopularity () {
1222          return $this->_objectMetier->computePopularity();
1223      }
1224  
1225      // }}}
1226  
1227      // {{{ getAuteurIdsForArticleId($articleId)
1228  
1229      /**
1230       * Returns an array of Author.
1231       *
1232       *
1233       * @return Array of Author
1234       * @param $articleId
1235       * @access public
1236       */
1237  
1238      function &getAuteurIdsForArticleId ($articleId) {
1239          return $this->_objectMetier->getAuteurIdsForArticleId($articleId);
1240      }
1241  
1242      // }}}
1243  
1244      // {{{ getAllForRubriqueIds($rubriques)
1245  
1246      /**
1247       * Returns an array of Article.
1248       *
1249       *
1250       * @return Array of Article
1251       * @param $rubriques
1252       * @access public
1253       */
1254  
1255      function &getAllForRubriqueIds ($rubriques) {
1256          return $this->_objectMetier->getAllForRubriqueIds($rubriques);
1257      }
1258  
1259      // }}}
1260  
1261      // {{{ getArticleIdsForAuteurId($auteurId)
1262  
1263      /**
1264       * Returns an array of Author.
1265       *
1266       *
1267       * @return Array of Author
1268       * @param $auteurId
1269       * @access public
1270       */
1271  
1272      function &getArticleIdsForAuteurId ($auteurId) {
1273          return $this->_objectMetier->getArticleIdsForAuteurId($auteurId);
1274      }
1275  
1276      // }}}
1277  
1278      // {{{ getAuteursForArticleId($articleId)
1279  
1280      /**
1281       * Returns an array of Author.
1282       *
1283       *
1284       * @return Array of Author
1285       * @param $articleId
1286       * @access public
1287       */
1288  
1289      function &getAuteursForArticleId ($articleId) {
1290          return $this->_objectMetier->getAuteursForArticleId($articleId);
1291      }
1292  
1293      // }}}
1294  
1295      // {{{ howManyArticleForMot($conf_mot, $aff_articles, $statut)
1296  
1297  	function howManyArticleForMot ($conf_mot, $aff_articles, $statut) {
1298          return $this->_objectMetier->howManyArticleForMot($conf_mot, $aff_articles, $statut);
1299      }
1300      // }}}
1301  
1302      // {{{ howManyArticlesForStatut($statut)
1303  
1304  	function howManyArticlesForStatut ($statut) {
1305          return $this->_objectMetier->howManyArticlesForStatut($statut);
1306      }
1307      // }}}
1308  
1309      // {{{ getAllDocumentsLies($id_article, $mode)
1310  
1311      /**
1312       * Returns an array of Document.
1313       *
1314       *
1315       * @return Array of Document
1316       * @param $id_article
1317       * @access public
1318       */
1319  
1320      function &getAllDocumentsLies ($id_article, $mode, $docs_exclus = "", $id_doublons = null) {
1321          return $this->_objectMetier->getAllDocumentsLies($id_article, $mode, $docs_exclus, $id_doublons);
1322      }
1323  
1324      // }}}
1325  
1326      function &getAllForArticleIds ($ids) {
1327          return $this->_objectMetier->getAllForArticleIds($ids);
1328      }
1329  
1330      // }}}
1331  
1332      function &getAllArticleIds () {
1333          return $this->_objectMetier->getAllArticleIds();
1334      }
1335  
1336      function &getAllForRubriqueId ($rubriqueId, $statut = null) {
1337          return $this->_objectMetier->getAllForRubriqueId($rubriqueId, $statut);
1338      }
1339  
1340      // }}}
1341  
1342      // {{{ addBookmark($id_auteur)
1343  
1344  	function addBookmark ($id_auteur) {
1345          // ? 
1346          $this->flushAllCache();
1347          return $this->_objectMetier->addBookmark($id_auteur);
1348      }
1349  
1350      // }}}
1351  
1352      // {{{ deleteBookmark($id_auteur)
1353  
1354  	function deleteBookmark ($id_auteur) {
1355          // ? 
1356          $this->flushAllCache();
1357          $this->_objectMetier->deleteBookmark($id_auteur);
1358      }
1359  
1360      // }}}
1361  
1362      // {{{ isBookmark($id_auteur)
1363  
1364  	function isBookmark ($id_auteur) {
1365          return $this->_objectMetier->isBookmark($id_auteur);
1366      }
1367  
1368      // }}}
1369  
1370      // {{{ getAllForStatut($statut)
1371  
1372      /**
1373       * Returns an array of Article.
1374       *
1375       * @return Array of Article
1376       * @param $statut
1377       * @access public
1378       */
1379  
1380      function &getAllForStatut ($statut, $orderBy = null, $desc = null) {
1381          $signature = $this->_cache->generateID('getAllForStatut' . $statut . $orderBy . $desc);
1382  
1383          if ($this->generalCacheExist($signature)) {
1384              return $this->loadGeneralCache($signature);
1385          }
1386          else {
1387              $result = $this->_objectMetier->getAllForStatut($statut, $orderBy, $desc);
1388  
1389              if (!PEAR::isError($result)) {
1390                  $this->saveGeneralCache($signature, $result);
1391              }
1392              return $result;
1393          }
1394  
1395      //return $this->_objectMetier->getAllForStatut($statut, $orderBy, $desc);
1396  
1397      }
1398  
1399      // }}}    
1400  
1401      // {{{ getArticlesOfTheDay($date)
1402  
1403      /**
1404       * Returns an array of Articles Of The Day..
1405       *
1406       * @return Array of Article
1407       * @param $date
1408       * @access public
1409       */
1410  
1411      function &getArticlesOfTheDay ($date) {
1412          return $this->_objectMetier->getArticlesOfTheDay($date);
1413      }
1414  
1415      // }}}
1416  
1417      // {{{ getAllMotherLang()
1418  
1419      /**
1420       * This method return la langue des rubriques mere pour chaque article fils
1421       * @return    Array
1422       */
1423  
1424  	function getAllMotherLang () {
1425          return $this->_objectMetier->getAllMotherLang();
1426      }
1427  
1428      // }}}
1429  
1430      // {{{ getAllArticleForStatutsOrderBy
1431  
1432      /**
1433       * This method return la liste des rubriques
1434       * @param statuts String
1435       * @param critere 
1436       * @return    Array
1437       */
1438  
1439  	function getAllArticleForStatutsOrderBy ($statuts, $critere = 'titre') {
1440          /*
1441          $signature = $this->_cache->generateID('getAllArticleForStatutsOrderBy'.$statuts.$critere);
1442          //$signature = 'getAllArticleForStatutsOrderBy'.$statuts.$critere;
1443          if ($this->generalCacheExist($signature)) {
1444              //echo 'LE CACHE EXISTE<br /><br />';
1445              return $this->loadGeneralCache($signature);            
1446          } else {
1447              //echo 'LE CACHE N\'EXISTE PAS<br /><br />';
1448              $result = $this->_objectMetier->getAllArticleForStatutsOrderBy($statuts, $critere);
1449              if (!PEAR::isError($result)) {
1450                  $this->saveGeneralCache($signature, $result);
1451              }
1452              return $result;
1453          }
1454          */
1455          return $this->_objectMetier->getAllArticleForStatutsOrderBy($statuts, $critere);
1456      }
1457  
1458      // }}}
1459  
1460      // {{{ howManyArticleForTradID($id_trad)
1461  
1462  	function howManyArticleForTradID ($id_trad) {
1463          return $this->_objectMetier->howManyArticleForTradID($id_trad);
1464      }
1465      // }}}
1466  
1467      // {{{ howManyXForRubriqueId($critere)
1468  
1469  	function howManyXForRubriqueId ($critere) {
1470          return $this->_objectMetier->howManyXForRubriqueId($critere);
1471      }
1472      // }}}
1473  
1474      // {{{ howManyX($critere)
1475  
1476  	function howManyX ($critere) {
1477          return $this->_objectMetier->howManyX($critere);
1478      }
1479      // }}}
1480  
1481      // {{{ howManyXGroupByLang($critere)
1482  
1483  	function howManyXGroupByLang ($critere) {
1484          return $this->_objectMetier->howManyXGroupByLang($critere);
1485      }
1486      // }}}
1487  
1488      // {{{ getAllArticleForTradId
1489  
1490      /**
1491       * This method return la liste des articles
1492       * @param statuts String
1493       * @param critere 
1494       * @return    Array
1495       */
1496  
1497  	function getAllArticleForTradId ($tradId) {
1498          return $this->_objectMetier->getAllArticleForTradId($tradId);
1499      }
1500  
1501      // }}}
1502  
1503      // {{{ getArticlesForStatutAndAuteur($statut, $auteurId)
1504  
1505      /**
1506       * This method return la liste des articles préparés par un auteur donné
1507       * @param statuts String
1508       * @param critere 
1509       * @return    Array
1510       */
1511  
1512  	function getArticlesForStatutAndAuteur ($statut, $auteurId) {
1513          $signature = $this->_cache->generateID('getArticlesForStatutAndAuteur' . $statut . $auteurId);
1514  
1515          if ($this->generalCacheExist($signature)) {
1516              return $this->loadGeneralCache($signature);
1517          }
1518          else {
1519              $result = $this->_objectMetier->getArticlesForStatutAndAuteur($statut, $auteurId);
1520  
1521              if (!PEAR::isError($result)) {
1522                  $this->saveGeneralCache($signature, $result);
1523              }
1524              return $result;
1525          }
1526  
1527      // return $this->_objectMetier->getArticlesForStatutAndAuteur($statut, $auteurId);
1528      }
1529  
1530      // }}}
1531  
1532      // {{{ getArticlesForRubriqueId($rubriqueId, $orderBy = null, $desc = null)
1533  
1534      /**
1535       * This method return la liste des articles d'une rubrique
1536       * @return    Array
1537       */
1538      // pas possible de mettre ca en cache ..... 
1539      function &getArticlesForRubriqueId ($rubriqueId, $orderBy = null, $desc = null) {
1540          return $this->_objectMetier->getArticlesForRubriqueId($rubriqueId, $orderBy, $desc);
1541      }
1542  
1543      // }}}
1544  
1545      // {{{ getArticlesForRubriqueIdAndAuteurIdAndStatuts($rubriqueId, $auteurId)
1546  
1547      /**
1548       * This method return la liste des articles d'une rubrique en fonction de l'auteur ou de leurs statuts.
1549       * @return    Array
1550       */
1551  
1552      function &getArticlesForRubriqueIdAndAuteurIdAndIDontKnowWhyButIloveYou ($rubriqueId, $auteurId) {
1553          return $this->_objectMetier->getArticlesForRubriqueIdAndAuteurIdAndIDontKnowWhyButIloveYou(
1554                     $rubriqueId, $auteurId);
1555      }
1556  
1557      // }}}
1558  
1559      // {{{ isStatutDoneArticleByAuteur($statut, $auteurId)
1560  
1561      /**
1562       * This method returns
1563       * @return  int
1564       * @access  public
1565       */
1566  	function isStatutDoneArticleByAuteur ($statut, $auteurId) {
1567          return $this->_objectMetier->isStatutDoneArticleByAuteur($statut, $auteurId);
1568      }
1569  
1570      // }}}    
1571  
1572      // {{{ getLangUsed()
1573  
1574      /**
1575       * This method return la liste des langues utilisés par les articles.
1576       * @return    Array
1577       */
1578  
1579      function &getLangUsed () {
1580          return $this->_objectMetier->getLangUsed();
1581      }
1582  
1583      // }}}
1584  
1585      // {{{ calculatePublishedRubrique()
1586  
1587      /**
1588       * This method return la liste des langues utilisés par les articles.
1589       * @return    Array
1590       */
1591  
1592      function &calculatePublishedRubrique ($trad_lang) {
1593          return $this->_objectMetier->calculatePublishedRubrique($trad_lang);
1594      }
1595  
1596      // }}}
1597  
1598      // {{{ calculatepublishedRubrique()
1599  
1600      /**
1601       * This method return la liste des langues utilisés par les articles.
1602       * @return    Array
1603       */
1604  
1605      function &calculateNoTraductionForRubrique ($trad_lang) {
1606          return $this->_objectMetier->calculateNoTraductionForRubrique($trad_lang);
1607      }
1608  
1609      // }}}
1610  
1611      // {{{ getTradStatistics()
1612  
1613      /**
1614       * This method return la liste des langues utilisés par les articles.
1615       * @return    Array
1616       */
1617  
1618      function &getTradStatistics ($trad_lang) {
1619          return $this->_objectMetier->getTradStatistics($trad_lang);
1620      }
1621  
1622      // }}}
1623  
1624      // {{{ switchVersion
1625  
1626      /**
1627       * This method switch an article with another version of itself
1628       * @return  Void  
1629       */
1630  
1631  	function switchVersion ($id_article, $id_article_version) {
1632          return $this->_objectMetier->switchVersion($id_article, $id_article_version);
1633      }
1634  
1635      // }}}
1636  
1637      // {{{ getAllForVersion
1638  
1639      /**
1640       * This method return an all articles for one version
1641       */
1642  	function getAllForVersion ($orderby) {
1643          return $this->_objectMetier->getAllForVersion($orderby);
1644      }
1645  
1646      /// }}}
1647  
1648      // {{{
1649  
1650      /**
1651       * fabrique un historique
1652       * @access public
1653       */
1654  
1655  	function create_historique () {
1656          return $this->_objectMetier->create_historique();
1657      }
1658  
1659      // }}}
1660  
1661      // {{{
1662  
1663      /**
1664      * compte le nbre dentree ds la table historique pour cet article
1665      * @access public
1666      */
1667  
1668  	function countHistorique () {
1669          return $this->_objectMetier->countHistorique();
1670      }
1671  
1672      // }}}
1673  
1674      // {{{
1675  
1676      /**
1677      * modifie l'article à partir d'un historique
1678      */
1679  	function switchHistorique ($id_article_historique) {
1680          return $this->_objectMetier->switchHistorique($id_article_historique);
1681      }
1682  
1683  // }}}
1684  }
1685  ?>


Généré le : Sat Feb 24 14:40:03 2007 par Balluche grâce à PHPXref 0.7