I'm using TableGateway's selectWith function to return a HydratingResultSet of entities. I need to iterate through each of the entities of the result set - not sure how I'm to do it, but using a foreach gives the error "This result is a forward only result set, calling rewind() after moving forward is not supported".
What I was trying to do is basically:
$res = $this->tableGateway->selectWith($query);
foreach($res as $r) {...}
What am I doing wrong? We're using Zend Framework 2.3. Thanks in advance!