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