Multiple pagination of arbitrary array of objects I have an array with this structure:

$things = array('term1' =&gt; array(Object, Object, ... Object),
                'term2' =&gt; array(Object, Object, ... Object),
                'term3' =&gt; array(Object, Object, ... Object),
                 .... etc...


I want to be able to generate output like:

Term1

* Object 1
* Object 2
* ... etc ...

 &lt; 1, 2, 3 &gt; (&lt;-- that's pagination :D)

Term2

* Object 1
* Object 2
* ... etc ...

 &lt; 1, 2, 3 &gt;


Which each list of things paginated (assuming there are more than x of them).

Is there a way I can achieve this? 

A template function I can pass each of the individual arrays of Objects into to get pagination?

If it matters, this is all taking place inside a block, in D7.
See Drupal Pagination with a Custom Query for full code example