Dumb implementation of missing PlSubIterator::first().
authorFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 6 Mar 2010 21:15:50 +0000 (22:15 +0100)
committerFlorent Bruneau <florent.bruneau@polytechnique.org>
Sat, 6 Mar 2010 21:15:50 +0000 (22:15 +0100)
Signed-off-by: Florent Bruneau <florent.bruneau@polytechnique.org>
classes/pliteratorutils.php

index eff6eda..46e0802 100644 (file)
@@ -438,6 +438,11 @@ class PlSubIterator implements PlIterator
         return ($this->source->last() && $this->next == null);
     }
 
+    public function first()
+    {
+        return $this->source->first();
+    }
+
     // Called by a subiterator to "rewind" the core iterator
     public function setNext($item)
     {
@@ -518,6 +523,11 @@ class PlInnerSubIterator implements PlIterator
         return $this->over;
     }
 
+    public function first()
+    {
+        return false;
+    }
+
 }
 
 // Wrapper class for 'arrayValueCallback' (get field $key of the given array)