Especially for easy pagination I often need access to the offset of a view result. Instead of maintaining it in the controller/view I added a getter to the result class:
diff --git a/application/library/Doctrine/CouchDB/View/Result.php b/application/library/Doctrine/CouchDB/View/Result.php
index 6398a17..3956bd0 100644
--- a/application/library/Doctrine/CouchDB/View/Result.php
+++ b/application/library/Doctrine/CouchDB/View/Result.php
@@ -67,4 +67,8 @@ class Result implements \IteratorAggregate, \Countable, \ArrayAccess
{
return $this->result['rows'];
}
+
+ public function getOffset() {
+ return $this->result['offset'];
+ }
}
Especially for easy pagination I often need access to the offset of a view result. Instead of maintaining it in the controller/view I added a getter to the result class:
It would be great if you could integrate it.
danielkbx