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.
|
|
|
|
* @package sapphire
|
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-05-05 16:52:50 +02:00
|
|
|
public function __construct($items = array()) {
|
|
|
|
user_error(
|
|
|
|
'DataObjectSet is deprecated, please use DataList or ArrayList instead.',
|
|
|
|
E_USER_NOTICE
|
|
|
|
);
|
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
|
|
|
}
|
|
|
|
|
2011-05-05 16:52:50 +02:00
|
|
|
}
|