Example #1
0
 /**
  * Merge a structure data to a node.
  *
  * @param   string          $path    The path to merge as root.
  * @param   Registry|mixed  $source  Source structure data to merge.
  * @param   boolean         $raw     Set to false to convert all object to array.
  *
  * @return  static
  */
 public function mergeTo($path, $source, $raw = false)
 {
     $nodes = RegistryHelper::getPathNodes($path);
     $data = array();
     $tmp =& $data;
     foreach ($nodes as $node) {
         $tmp[$node] = array();
         $tmp =& $tmp[$node];
     }
     if ($source instanceof Registry) {
         $source = $source->getRaw();
     }
     $tmp = $source;
     $this->bindData($this->data, $data, $raw);
     return $this;
 }