src/Query/Node/NodeBase.php
public function _MergeExpansionNode(NodeBase $objNewNode)
    {
        if (!$objNewNode || empty($objNewNode->objChildNodeArray)) {
            return;
        }
        if ($objNewNode->strName != $this->strName) {
            throw new Caller('Expansion node tables must match.');
        }

        if (!$this->objChildNodeArray) {
            $this->objChildNodeArray = $objNewNode->objChildNodeArray;
        } else {
            $objChildNode = reset($objNewNode->objChildNodeArray);
            if (isset ($this->objChildNodeArray[$objChildNode->strAlias])) {
                if ($objChildNode->blnExpandAsArray) {
                    $this->objChildNodeArray[$objChildNode->strAlias]->blnExpandAsArray = true;
                    // assume this is a leaf node, so don't follow any more.
                } else {
                    $this->objChildNodeArray[$objChildNode->strAlias]->_MergeExpansionNode($objChildNode);
                }
            } else {
                $this->objChildNodeArray[$objChildNode->strAlias] = $objChildNode;
            }
        }
    }
public function _MergeExpansionNode(NodeBase $objNewNode)
    {
        if (!$objNewNode || empty($objNewNode->objChildNodeArray)) {
            return;
        }
        if ($objNewNode->strName != $this->strName) {
            throw new Caller('Expansion node tables must match.');
        }

        if (!$this->objChildNodeArray) {
            $this->objChildNodeArray = $objNewNode->objChildNodeArray;
        } else {
            $objChildNode = reset($objNewNode->objChildNodeArray);
            if (isset ($this->objChildNodeArray[$objChildNode->strAlias])) {
                if ($objChildNode->blnExpandAsArray) {
                    $this->objChildNodeArray[$objChildNode->strAlias]->blnExpandAsArray = true;
                    // assume this is a leaf node, so don't follow any more.
                } else {
                    $this->objChildNodeArray[$objChildNode->strAlias]->_MergeExpansionNode($objChildNode);
                }
            } else {
                $this->objChildNodeArray[$objChildNode->strAlias] = $objChildNode;
            }
        }
    }
public function _MergeExpansionNode ( NodeBase $ objNewNode ) { if ( ! $ objNewNode || empty ( $ objNewNode -> objChildNodeArray ) ) { return ; } if ( $ objNewNode -> strName != $ this -> strName ) { throw new Caller ( 'Expansion node tables must match.' ) ; } if ( ! $ this -> objChildNodeArray ) { $ this -> objChildNodeArray = $ objNewNode -> objChildNodeArray ; } else { $ objChildNode = reset ( $ objNewNode -> objChildNodeArray ) ; if ( isset ( $ this -> objChildNodeArray [ $ objChildNode -> strAlias ] ) ) { if ( $ objChildNode -> blnExpandAsArray ) { $ this -> objChildNodeArray [ $ objChildNode -> strAlias ] -> blnExpandAsArray = true ; // assume this is a leaf node, so don't follow any more. } else { $ this -> objChildNodeArray [ $ objChildNode -> strAlias ] -> _MergeExpansionNode ( $ objChildNode ) ; } } else { $ this -> objChildNodeArray [ $ objChildNode -> strAlias ] = $ objChildNode ; } } }
Merges a node tree into this node, building the child nodes. The node being received
is assumed to be specially built node such that only one child node exists, if any,
and the last node in the chain is designated as array expansion. The goal of all of this
is to set up a node chain where intermediate nodes can be designated as being array
expansion nodes, as well as the leaf nodes.

@param NodeBase $objNewNode
@throws Caller
Merges a node tree into this node building the child nodes . The node being received is assumed to be specially built node such that only one child node exists if any and the last node in the chain is designated as array expansion . The goal of all of this is to set up a node chain where intermediate nodes can be designated as being array expansion nodes as well as the leaf nodes .