Permalink
Browse files

API CHANGE: Added ArrayList::dataClass(), which will return the class…

… of the first item in the list.
  • Loading branch information...
1 parent 6a08a82 commit 3c1d62acfd68913fb2864b3d294ef4521f5e78ad @sminnee sminnee committed Jan 10, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 model/ArrayList.php
View
@@ -34,6 +34,13 @@ public function __construct(array $items = array()) {
$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

0 comments on commit 3c1d62a

Please sign in to comment.