vrana/notorm — Issue #39: second loop through a NotORM_Result in a variable fails
Author: xpavp03
Created: 2012-01-15 12:43:58+00:00
State: open

Please have a look at these two tests:
http://tmp.pepa.info/notorm/32.1-failing-repeated-loop.phpt
http://tmp.pepa.info/notorm/32.2-working-repeated-loop.phpt

The only difference between the two is that in the failing case, I store $software->author() in a variable and use that variable when looping.

I found out that the second loop ends up prematurely because of nulling in NotORM_Result::__destruct().
https://github.com/vrana/notorm/blob/master/NotORM/Result.php#L34

To work around the issue, I can clone my variable before the first loop however, that causes related SQL queries to be executed again for each loop.