public function mergeTo($path, $source, $raw = false, array $options = [])
    {
        $nodes = StructureHelper::getPathNodes($path);

        $data = [];

        $tmp =& $data;

        foreach ($nodes as $node) {
            $tmp[$node] = [];

            $tmp =& $tmp[$node];
        }

        if ($source instanceof self) {
            $source = $source->getRaw();
        }

        $tmp = $source;

        $this->bindData($this->data, $data, $raw, $options);

        return $this;
    }
public function mergeTo($path, $source, $raw = false, array $options = [])
    {
        $nodes = StructureHelper::getPathNodes($path);

        $data = [];

        $tmp =& $data;

        foreach ($nodes as $node) {
            $tmp[$node] = [];

            $tmp =& $tmp[$node];
        }

        if ($source instanceof self) {
            $source = $source->getRaw();
        }

        $tmp = $source;

        $this->bindData($this->data, $data, $raw, $options);

        return $this;
    }
public function mergeTo ( $ path , $ source , $ raw = false , array $ options = [ ] ) { $ nodes = StructureHelper :: getPathNodes ( $ path ) ; $ data = [ ] ; $ tmp = & $ data ; foreach ( $ nodes as $ node ) { $ tmp [ $ node ] = [ ] ; $ tmp = & $ tmp [ $ node ] ; } if ( $ source instanceof self ) { $ source = $ source -> getRaw ( ) ; } $ tmp = $ source ; $ this -> bindData ( $ this -> data , $ data , $ raw , $ options ) ; return $ this ; }
Merge a structure data to a node.

@param   string    $path    The path to merge as root.
@param   Structure $source  Source structure data to merge.
@param   boolean   $raw     Set to false to convert all object to array.
@param   array     $options Options to bind data.

@return  static
Merge a structure data to a node .