src/xPDO/Om/xPDOQuery.php
public function hydrateGraph($rows, $cacheFlag = true) {
        $instances= array ();
        $collectionCaching = $this->xpdo->getOption(xPDO::OPT_CACHE_DB_COLLECTIONS, array(), 1);
        if (is_object($rows)) {
            if ($cacheFlag && $this->xpdo->_cacheEnabled && $collectionCaching > 0) {
                $cacheRows = array();
            }
            while ($row = $rows->fetch(\PDO::FETCH_ASSOC)) {
                $this->hydrateGraphParent($instances, $row);
                if ($cacheFlag && $this->xpdo->_cacheEnabled && $collectionCaching > 0) {
                    $cacheRows[]= $row;
                }
            }
            if ($cacheFlag && $this->xpdo->_cacheEnabled && $collectionCaching > 0) {
                $this->xpdo->toCache($this, $cacheRows, $cacheFlag);
            }
        } elseif (is_array($rows)) {
            foreach ($rows as $row) {
                $this->hydrateGraphParent($instances, $row);
            }
        }
        return $instances;
    }
public function hydrateGraph($rows, $cacheFlag = true) {
        $instances= array ();
        $collectionCaching = $this->xpdo->getOption(xPDO::OPT_CACHE_DB_COLLECTIONS, array(), 1);
        if (is_object($rows)) {
            if ($cacheFlag && $this->xpdo->_cacheEnabled && $collectionCaching > 0) {
                $cacheRows = array();
            }
            while ($row = $rows->fetch(\PDO::FETCH_ASSOC)) {
                $this->hydrateGraphParent($instances, $row);
                if ($cacheFlag && $this->xpdo->_cacheEnabled && $collectionCaching > 0) {
                    $cacheRows[]= $row;
                }
            }
            if ($cacheFlag && $this->xpdo->_cacheEnabled && $collectionCaching > 0) {
                $this->xpdo->toCache($this, $cacheRows, $cacheFlag);
            }
        } elseif (is_array($rows)) {
            foreach ($rows as $row) {
                $this->hydrateGraphParent($instances, $row);
            }
        }
        return $instances;
    }
public function hydrateGraph ( $ rows , $ cacheFlag = true ) { $ instances = array ( ) ; $ collectionCaching = $ this -> xpdo -> getOption ( xPDO :: OPT_CACHE_DB_COLLECTIONS , array ( ) , 1 ) ; if ( is_object ( $ rows ) ) { if ( $ cacheFlag && $ this -> xpdo -> _cacheEnabled && $ collectionCaching > 0 ) { $ cacheRows = array ( ) ; } while ( $ row = $ rows -> fetch ( \ PDO :: FETCH_ASSOC ) ) { $ this -> hydrateGraphParent ( $ instances , $ row ) ; if ( $ cacheFlag && $ this -> xpdo -> _cacheEnabled && $ collectionCaching > 0 ) { $ cacheRows [ ] = $ row ; } } if ( $ cacheFlag && $ this -> xpdo -> _cacheEnabled && $ collectionCaching > 0 ) { $ this -> xpdo -> toCache ( $ this , $ cacheRows , $ cacheFlag ) ; } } elseif ( is_array ( $ rows ) ) { foreach ( $ rows as $ row ) { $ this -> hydrateGraphParent ( $ instances , $ row ) ; } } return $ instances ; }
Hydrates a graph of related objects from a single result set.

@param array|\PDOStatement $rows A collection of result set rows or an
executed PDOStatement to fetch rows from to hydrating the graph.
@param bool $cacheFlag Indicates if the objects should be cached and
optionally, by specifying an integer value, for how many seconds.
@return array A collection of objects with all related objects from the
graph pre-populated.
Hydrates a graph of related objects from a single result set .