[ Index ]
 

Code source de b2evolution 2.1.0-beta

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/blogs/inc/_core/model/dataobjects/ -> _dataobjectlist.class.php (source)

   1  <?php
   2  /**

   3   * This file implements the abstract DataObjectList base class.

   4   *

   5   * This file is part of the evoCore framework - {@link http://evocore.net/}

   6   * See also {@link http://sourceforge.net/projects/evocms/}.

   7   *

   8   * @copyright (c)2003-2007 by Francois PLANQUE - {@link http://fplanque.net/}

   9   *

  10   * {@internal License choice

  11   * - If you have received this file as part of a package, please find the license.txt file in

  12   *   the same folder or the closest folder above for complete license terms.

  13   * - If you have received this file individually (e-g: from http://evocms.cvs.sourceforge.net/)

  14   *   then you must choose one of the following licenses before using the file:

  15   *   - GNU General Public License 2 (GPL) - http://www.opensource.org/licenses/gpl-license.php

  16   *   - Mozilla Public License 1.1 (MPL) - http://www.opensource.org/licenses/mozilla1.1.php

  17   * }}

  18   *

  19   * {@internal Open Source relicensing agreement:

  20   * }}

  21   *

  22   * @package evocore

  23   *

  24   * {@internal Below is a list of authors who have contributed to design/coding of this file: }}

  25   * @author fplanque: Francois PLANQUE

  26   *

  27   * @version $Id: _dataobjectlist.class.php,v 1.1 2007/06/25 10:58:56 fplanque Exp $

  28   */
  29  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  30  
  31  load_funcs('_core/ui/results/_results.class.php');
  32  
  33  /**

  34   * Data Object List Base Class

  35   *

  36   * This is typically an abstract class, useful only when derived.

  37   * Holds DataObjects in an array and allows walking through...

  38   *

  39   * @package evocore

  40   * @version beta

  41   * @abstract

  42   */
  43  class DataObjectList extends Results
  44  {
  45  
  46      /**

  47       * The following should probably be obsoleted by Results::Cache

  48       */
  49      var    $dbtablename;
  50      var $dbprefix;
  51      var $dbIDname;
  52  
  53      /**

  54       * Class name of objects handled in this list

  55       */
  56      var $objType;
  57  
  58      /**

  59       * Object array

  60       */
  61      var $Obj = array();
  62  
  63  
  64      /**

  65       * Constructor

  66       *

  67       * If provided, executes SQL query via parent Results object

  68       *

  69       * @param string Name of table in database

  70       * @param string Prefix of fields in the table

  71       * @param string Name of the ID field (including prefix)

  72       * @param string Name of Class for objects within this list

  73       * @param string SQL query

  74       * @param integer number of lines displayed on one screen

  75       * @param string prefix to differentiate page/order params when multiple Results appear one same page

  76       * @param string default ordering of columns (special syntax)

  77       */
  78  	function DataObjectList( $tablename, $prefix = '', $dbIDname = 'ID', $objType = 'Item', $sql = NULL,
  79                                                          $limit = 20, $param_prefix = '', $default_order = NULL )
  80      {
  81          $this->dbtablename = $tablename;
  82          $this->dbprefix = $prefix;
  83          $this->dbIDname = $dbIDname;
  84          $this->objType = $objType;
  85  
  86          if( !is_null( $sql ) )
  87          {    // We have an SQL query to execute:
  88              parent::Results( $sql, $param_prefix, $default_order, $limit );
  89          }
  90          else
  91          {    // TODO: do we want to autogenerate a query here???
  92              // Temporary...

  93              parent::Results( $sql, $param_prefix, $default_order, $limit );
  94          }
  95      }
  96  
  97  
  98      /**

  99       * Get next object in list

 100       *

 101       * @return DataObject

 102       */
 103      function & get_next()
 104      {
 105          if( $this->current_idx >= $this->result_num_rows )
 106          {    // No more comment in list
 107              $r = false;
 108              return $r;
 109          }
 110          return $this->Obj[$this->current_idx++];
 111      }
 112  
 113  }
 114  
 115  /*

 116   * $Log: _dataobjectlist.class.php,v $

 117   * Revision 1.1  2007/06/25 10:58:56  fplanque

 118   * MODULES (refactored MVC)

 119   *

 120   * Revision 1.6  2007/04/26 00:11:09  fplanque

 121   * (c) 2007

 122   *

 123   * Revision 1.5  2006/11/24 18:27:24  blueyed

 124   * Fixed link to b2evo CVS browsing interface in file docblocks

 125   */
 126  ?>


Généré le : Thu Nov 29 23:58:50 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics