[ Index ]

PHP Cross Reference of MantisBT

title

Body

[close]

/library/rssbuilder/ -> class.ObjectList.inc.php (source)

   1  <?php
   2  require_once  'class.RSSBase.inc.php';
   3  /**
   4  * Class for creating an RSS-feed
   5  * @author Michael Wimmer <flaimo@gmail.com>
   6  * @category flaimo-php
   7  * @copyright Copyright © 2002-2008, Michael Wimmer
   8  * @license GNU General Public License v3
   9  * @link http://code.google.com/p/flaimo-php/
  10  * @package RSS
  11  * @version 2.2.1
  12  */
  13  abstract class ObjectList extends RSSBase implements IteratorAggregate {
  14  
  15      protected $size = 20;
  16      protected $offset = 0;
  17      public $objects;
  18      protected $factory;
  19  
  20  	function __construct($offset = 0, $size = 20) {
  21          parent::__construct();
  22          $this->setSize($size);
  23          $this->setOffset($offset);
  24      } // end constructor
  25  
  26  	public function setSize($size = 20) {
  27          $this->size = (int) $size;
  28      } // end function
  29  
  30  	public function setOffset($offset = 0) {
  31          $this->offset = (int) $offset;
  32      } // end function
  33  
  34  	public function addObject($object) {
  35          if (is_object($object)) {
  36              $this->objects[] = $object;
  37              return (boolean) TRUE;
  38          } // end if
  39          return (boolean) FALSE;
  40      } // end function
  41  
  42      public function &getSize() {
  43          return $this->size;
  44      } // end function
  45      
  46      public function &getListSize() {
  47          return count($this->getList());
  48      } // end function    
  49  
  50      public function &getOffset() {
  51          return $this->offset;
  52      } // end function
  53  
  54      public function &getList() {
  55          return $this->objects;
  56      } // end function
  57  
  58  	public function setFactory($class_name = FALSE) {
  59          if (!isset($class_name) || $class_name === FALSE) {
  60              return (boolean) FALSE;
  61          } // end if
  62          
  63          $this->factory =& parent::getObjectFactory($class_name);
  64          return (boolean) TRUE;
  65      } // end function
  66      
  67  	public function getIterator() {
  68          return new ObjectIterator($this);
  69      } // end function
  70  } // end class
  71  ?>


Generated: Thu Jul 28 15:48:31 2011 Cross-referenced by PHPXref 0.7