API CHANGE: Added ArrayList::dataClass(), which will return the class of the first item in the list.

This commit is contained in:
Sam Minnee 2012-01-10 16:58:49 +13:00
parent 6a08a82c9c
commit 3c1d62acfd

View File

@ -34,6 +34,13 @@ class ArrayList extends ViewableData implements SS_List {
$this->items = $items;
parent::__construct();
}
/**
* Return the class of items in this list, by looking at the first item inside it.
*/
function dataClass() {
if(count($this->items) > 0) return get_class($this->items[0]);
}
/**
* Return the number of items in this list