Dumb implementation of missing PlSubIterator::first().
[platal.git] / 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)