source/Spiral/ORM/Entities/Nodes/AbstractNode.php
final public function parseRow(int $dataOffset, array $row): int
    {
        //Fetching Node specific data from resulted row
        $data = $this->fetchData($dataOffset, $row);

        if ($this->deduplicate($data)) {
            //Create reference keys
            $this->collectReferences($data);

            //Make sure that all nested relations are registered
            $this->ensurePlaceholders($data);

            //Add data into result set
            $this->pushData($data);
        } elseif (!empty($this->parent)) {
            //Registering duplicates rows in each parent row
            $this->pushData($data);
        }

        $innerOffset = 0;
        foreach ($this->nodes as $container => $node) {
            if ($node->joined) {
                /**
                 * We are looking into branch like structure:
                 * node
                 *  - node
                 *      - node
                 *      - node
                 * node
                 *
                 * This means offset has to be calculated using all nested nodes
                 */
                $innerColumns = $node->parseRow($this->countColumns + $dataOffset, $row);

                //Counting next selection offset
                $dataOffset += $innerColumns;

                //Counting nested tree offset
                $innerOffset += $innerColumns;
            }
        }

        return $this->countColumns + $innerOffset;
    }
final public function parseRow(int $dataOffset, array $row): int
    {
        //Fetching Node specific data from resulted row
        $data = $this->fetchData($dataOffset, $row);

        if ($this->deduplicate($data)) {
            //Create reference keys
            $this->collectReferences($data);

            //Make sure that all nested relations are registered
            $this->ensurePlaceholders($data);

            //Add data into result set
            $this->pushData($data);
        } elseif (!empty($this->parent)) {
            //Registering duplicates rows in each parent row
            $this->pushData($data);
        }

        $innerOffset = 0;
        foreach ($this->nodes as $container => $node) {
            if ($node->joined) {
                /**
                 * We are looking into branch like structure:
                 * node
                 *  - node
                 *      - node
                 *      - node
                 * node
                 *
                 * This means offset has to be calculated using all nested nodes
                 */
                $innerColumns = $node->parseRow($this->countColumns + $dataOffset, $row);

                //Counting next selection offset
                $dataOffset += $innerColumns;

                //Counting nested tree offset
                $innerOffset += $innerColumns;
            }
        }

        return $this->countColumns + $innerOffset;
    }
final public function parseRow ( int $ dataOffset , array $ row ) : int { //Fetching Node specific data from resulted row $ data = $ this -> fetchData ( $ dataOffset , $ row ) ; if ( $ this -> deduplicate ( $ data ) ) { //Create reference keys $ this -> collectReferences ( $ data ) ; //Make sure that all nested relations are registered $ this -> ensurePlaceholders ( $ data ) ; //Add data into result set $ this -> pushData ( $ data ) ; } elseif ( ! empty ( $ this -> parent ) ) { //Registering duplicates rows in each parent row $ this -> pushData ( $ data ) ; } $ innerOffset = 0 ; foreach ( $ this -> nodes as $ container => $ node ) { if ( $ node -> joined ) { /**
                 * We are looking into branch like structure:
                 * node
                 *  - node
                 *      - node
                 *      - node
                 * node
                 *
                 * This means offset has to be calculated using all nested nodes
                 */ $ innerColumns = $ node -> parseRow ( $ this -> countColumns + $ dataOffset , $ row ) ; //Counting next selection offset $ dataOffset += $ innerColumns ; //Counting nested tree offset $ innerOffset += $ innerColumns ; } } return $ this -> countColumns + $ innerOffset ; }
Parser result work, fetch data and mount it into parent tree.

@param int   $dataOffset
@param array $row

@return int Must return number of handled columns.
Parser result work fetch data and mount it into parent tree .