Update object value within foreach loop
<p>I would like to loop through the contents of a query object update certain values and return the object.</p>

<pre><code>function clearAllIds($queryObject)
{ 
   foreach($queryObject-&gt;result() as $row)
 {
  $row-&gt;id = 0;
 }
return $queryObject
}
</code></pre>

<p>In this example I would like to zero out all of the ID values. How can I accomplish this within the foreach loop?</p>

<p>Please excuse the formatting.</p>
