Changeset 928

Show
Ignore:
Timestamp:
07/22/08 21:21:10 (1 month ago)
Author:
kaste
Message:

Refactor. Moved logic from findBySqlWithAssociations to ->_generateObjectGraphFromResultSet.

'A chance to refactor and improve this.'

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/AkActiveRecord/AkAssociatedActiveRecord.php

    r660 r928  
    343343            return $objects; 
    344344        } 
     345        $result =& $this->_generateObjectGraphFromResultSet($results,$included_associations,$virtual_limit); 
     346        return $result; 
     347    } 
     348     
     349    /** 
     350     * Pass hand-made sql directly to _db->execute and generate the OG with this method. 
     351     * 
     352     * @param ADOResultSet $results            a result set from Db->execute 
     353     * @param array $included_associations     just like in ->find(); $options['include']; but in fact unused 
     354     * @param mixed $virtual_limit             int or false; unsure if this works                      
     355     * @return array                           ObjectGraph as an array 
     356     */ 
     357    function &_generateObjectGraphFromResultSet($results,$included_associations = array(), $virtual_limit = false) 
     358    { 
     359        $objects = array(); 
    345360         
    346361        $i = 0;