public function process(array $rows)
    {
        foreach ($this->queue as $queue) {
            // Just references
            $relation = $queue[self::PARAM_RELATION];
            $args = $queue[self::PARAM_ARGS];

            switch ($relation) {
                case 'asOneToMany':
                    $relation = new OneToMany($this->db);

                    // Grab values from arguments passed in $db->asOneToMany()
                    $slaveTable = $args[0];
                    $slaveColumnId = $args[1];
                    $alias = $args[2];

                    $rows = $relation->merge($this->getMasterPkName(), $rows, $alias, $slaveTable, $slaveColumnId);
                break;

                case 'asOneToOne':
                    // Grab values from arguments passed in $db->asOneToOne()
                    $column = $args[0];
                    $alias = $args[1];
                    $table = $args[2];
                    $link = $args[3];

                    $relation = new OneToOne($this->db);
                    $rows = $relation->merge($rows, $column, $alias, $table, $link);
                break;

                case 'asManyToMany':
                    // Grab values from arguments passed in $db->asManyToMany()
                    $alias = $args[0];
                    $junction = $args[1];
                    $column = $args[2];
                    $table = $args[3];
                    $pk = $args[4];
                    $columns = $args[5];

                    $relation = new ManyToMany($this->db);
                    $rows = $relation->merge($this->getMasterPkName(), $alias, $rows, $junction, $column, $table, $pk, $columns);
                break;
            }
        }

        $this->clearQueue();
        return $rows;
    }
public function process(array $rows)
    {
        foreach ($this->queue as $queue) {
            // Just references
            $relation = $queue[self::PARAM_RELATION];
            $args = $queue[self::PARAM_ARGS];

            switch ($relation) {
                case 'asOneToMany':
                    $relation = new OneToMany($this->db);

                    // Grab values from arguments passed in $db->asOneToMany()
                    $slaveTable = $args[0];
                    $slaveColumnId = $args[1];
                    $alias = $args[2];

                    $rows = $relation->merge($this->getMasterPkName(), $rows, $alias, $slaveTable, $slaveColumnId);
                break;

                case 'asOneToOne':
                    // Grab values from arguments passed in $db->asOneToOne()
                    $column = $args[0];
                    $alias = $args[1];
                    $table = $args[2];
                    $link = $args[3];

                    $relation = new OneToOne($this->db);
                    $rows = $relation->merge($rows, $column, $alias, $table, $link);
                break;

                case 'asManyToMany':
                    // Grab values from arguments passed in $db->asManyToMany()
                    $alias = $args[0];
                    $junction = $args[1];
                    $column = $args[2];
                    $table = $args[3];
                    $pk = $args[4];
                    $columns = $args[5];

                    $relation = new ManyToMany($this->db);
                    $rows = $relation->merge($this->getMasterPkName(), $alias, $rows, $junction, $column, $table, $pk, $columns);
                break;
            }
        }

        $this->clearQueue();
        return $rows;
    }
public function process ( array $ rows ) { foreach ( $ this -> queue as $ queue ) { // Just references $ relation = $ queue [ self :: PARAM_RELATION ] ; $ args = $ queue [ self :: PARAM_ARGS ] ; switch ( $ relation ) { case 'asOneToMany' : $ relation = new OneToMany ( $ this -> db ) ; // Grab values from arguments passed in $db->asOneToMany() $ slaveTable = $ args [ 0 ] ; $ slaveColumnId = $ args [ 1 ] ; $ alias = $ args [ 2 ] ; $ rows = $ relation -> merge ( $ this -> getMasterPkName ( ) , $ rows , $ alias , $ slaveTable , $ slaveColumnId ) ; break ; case 'asOneToOne' : // Grab values from arguments passed in $db->asOneToOne() $ column = $ args [ 0 ] ; $ alias = $ args [ 1 ] ; $ table = $ args [ 2 ] ; $ link = $ args [ 3 ] ; $ relation = new OneToOne ( $ this -> db ) ; $ rows = $ relation -> merge ( $ rows , $ column , $ alias , $ table , $ link ) ; break ; case 'asManyToMany' : // Grab values from arguments passed in $db->asManyToMany() $ alias = $ args [ 0 ] ; $ junction = $ args [ 1 ] ; $ column = $ args [ 2 ] ; $ table = $ args [ 3 ] ; $ pk = $ args [ 4 ] ; $ columns = $ args [ 5 ] ; $ relation = new ManyToMany ( $ this -> db ) ; $ rows = $ relation -> merge ( $ this -> getMasterPkName ( ) , $ alias , $ rows , $ junction , $ column , $ table , $ pk , $ columns ) ; break ; } } $ this -> clearQueue ( ) ; return $ rows ; }
Processes a raw result-set appending relational data if necessary

@param array $rows Target collection of rows
@return array
Processes a raw result - set appending relational data if necessary