|
|
@@ -79,7 +79,6 @@ class Collection implements \Countable, \IteratorAggregate, \ArrayAccess
|
|
|
// Collection specific methods
|
|
|
//
|
|
|
|
|
|
-
|
|
|
function get($forceCollection = false)
|
|
|
{
|
|
|
if (sizeof($this->items) == 1 && !$forceCollection) {
|
|
|
@@ -130,4 +129,17 @@ class Collection implements \Countable, \IteratorAggregate, \ArrayAccess
|
|
|
return $this->items[0];
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ /**
|
|
|
+ * Iterate over the colletion
|
|
|
+ *
|
|
|
+ * @param mixed $function
|
|
|
+ * @return void
|
|
|
+ */
|
|
|
+ function each($function)
|
|
|
+ {
|
|
|
+ foreach($this->items as $item){
|
|
|
+ $function($item);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|