mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
API CHANGE: Added ArrayList::dataClass(), which will return the class of the first item in the list.
This commit is contained in:
parent
6a08a82c9c
commit
3c1d62acfd
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user