b2evolution

Multilingual multiuser multiblog engine

b2evolution Technical Documentation (CVS HEAD) [ class tree: evocore ] [ index: evocore ] [ all elements ]

Source for file _dataobjectlist.class.php

Documentation is available at _dataobjectlist.class.php

  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-2010 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.6 2010/02/08 17:51:50 efy-yury Exp $
  28.  */
  29. if!defined('EVO_MAIN_INIT') ) die'Please, do not access this page directly.' );
  30.  
  31. load_class('_core/ui/results/_results.class.php''Results' );
  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.6  2010/02/08 17:51:50  efy-yury
  118.  * copyright 2009 -> 2010
  119.  *
  120.  * Revision 1.5  2009/09/14 10:38:23  efy-arrin
  121.  * Include the ClassName in the load_class() with proper UpperCase
  122.  *
  123.  * Revision 1.4  2009/03/08 23:57:40  fplanque
  124.  * 2009
  125.  *
  126.  * Revision 1.3  2009/02/26 22:16:54  blueyed
  127.  * Use load_class for classes (.class.php), and load_funcs for funcs (.funcs.php)
  128.  *
  129.  * Revision 1.2  2008/01/21 09:35:24  fplanque
  130.  * (c) 2008
  131.  *
  132.  * Revision 1.1  2007/06/25 10:58:56  fplanque
  133.  * MODULES (refactored MVC)
  134.  *
  135.  * Revision 1.6  2007/04/26 00:11:09  fplanque
  136.  * (c) 2007
  137.  *
  138.  * Revision 1.5  2006/11/24 18:27:24  blueyed
  139.  * Fixed link to b2evo CVS browsing interface in file docblocks
  140.  */
  141. ?>

Documentation generated on Sat, 06 Mar 2010 04:07:53 +0100 by phpDocumentor 1.4.2. This site is hosted and maintained by Daniel HAHLER (Contact).