2007-07-19 12:40:28 +02:00
|
|
|
<?php
|
|
|
|
/**
|
2011-05-05 16:52:50 +02:00
|
|
|
* @deprecated Please use {@link DataList} or {@link ArrayList} instead.
|
2012-04-12 08:02:46 +02:00
|
|
|
* @package framework
|
2008-02-25 03:10:37 +01:00
|
|
|
* @subpackage model
|
2007-07-19 12:40:28 +02:00
|
|
|
*/
|
2011-05-05 16:52:50 +02:00
|
|
|
class DataObjectSet extends ArrayList {
|
2007-07-19 12:40:28 +02:00
|
|
|
|
2011-10-28 03:36:20 +02:00
|
|
|
/**
|
2011-10-29 01:02:11 +02:00
|
|
|
* @deprecated 3.0
|
2011-10-28 03:36:20 +02:00
|
|
|
*/
|
2011-05-05 16:52:50 +02:00
|
|
|
public function __construct($items = array()) {
|
2011-10-29 01:02:11 +02:00
|
|
|
Deprecation::notice('3.0', 'Use DataList or ArrayList instead');
|
2007-07-19 12:40:28 +02:00
|
|
|
|
2011-05-05 16:52:50 +02:00
|
|
|
if ($items) {
|
|
|
|
if (!is_array($items) || func_num_args() > 1) {
|
|
|
|
$items = func_get_args();
|
2007-07-19 12:40:28 +02:00
|
|
|
}
|
2007-09-14 19:59:33 +02:00
|
|
|
|
2011-05-05 16:52:50 +02:00
|
|
|
foreach ($items as $i => $item) {
|
|
|
|
if ($item instanceof ViewableData) {
|
|
|
|
continue;
|
2007-07-19 12:40:28 +02:00
|
|
|
}
|
2007-09-14 19:59:33 +02:00
|
|
|
|
2011-05-05 16:52:50 +02:00
|
|
|
if (is_object($item) || ArrayLib::is_associative($item)) {
|
|
|
|
$items[$i] = new ArrayData($item);
|
2007-07-19 12:40:28 +02:00
|
|
|
} else {
|
2011-05-05 16:52:50 +02:00
|
|
|
user_error(
|
|
|
|
"DataObjectSet::__construct: Passed item #{$i} is not an"
|
|
|
|
. ' and object or associative array, can\'t be properly'
|
|
|
|
. ' iterated on in templates', E_USER_WARNING
|
|
|
|
);
|
2007-07-19 12:40:28 +02:00
|
|
|
}
|
2007-09-14 19:59:33 +02:00
|
|
|
}
|
2010-12-11 06:43:08 +01:00
|
|
|
}
|
|
|
|
|
2011-05-05 16:52:50 +02:00
|
|
|
parent::__construct($items);
|
2008-03-11 02:31:43 +01:00
|
|
|
}
|
|
|
|
|
2012-03-24 04:04:52 +01:00
|
|
|
}
|