title: Kohana 3 ORM as_array return array of ORM
body: <p>I'm executing a simple query and want to get an array back.
  Based on the ORM tutorial that comes with the Kohana 3 guide, I thought I could do the following:</p>
  
  <pre><code>ORM::factory('user')-&gt;find_all()-&gt;as_array();
  </code></pre>
  
  <p>But that seems to give me an array of model objects (ie array( User_Model1, User_Model2 ...</p>
  
  <p>Looking at the source I see I can easily fix this by hacking with the following patch.</p>
  
  <pre><code>modules/database/classes/kohana/database/result.php
  @@ -94,7 +94,7 @@
                          foreach ($this as $row)
                          {
  -                               $results[] = $row;
  +                               $results[] = $row-&gt;as_array();
  </code></pre>
  
  <p>Which seems to be more in line with what the user guide says:</p>
  
  <blockquote>
    <p>A powerful feature of ORM is the ORM::as_array method which will return the given record as an array. If used with ORM::find_all, an array of all records will be returned. A good example of when this is useful is for a select list:</p>
    
    <p>// Display a select field of usernames (using the id as values) echo
       Form::select('user', ORM::factory('user')->find_all()->as_array('id', 'username'));</p>
  </blockquote>
  
  <p>Wondering if this is intentional, if so, why?
  What would be a better work around if I do want to create an array of associative arrays?</p>