public function setRootAndPath(Document $root, $path)
    {
        Archive::set($this, 'root_and_path', array('root' => $root, 'path' => $path));

        if (isset($this->data['embeddedsOne'])) {
            foreach ($this->data['embeddedsOne'] as $name => $embedded) {
                $embedded->setRootAndPath($root, $path.'.'.$name);
            }
        }

        if (isset($this->data['embeddedsMany'])) {
            foreach ($this->data['embeddedsMany'] as $name => $embedded) {
                $embedded->setRootAndPath($root, $path.'.'.$name);
            }
        }
    }
public function setRootAndPath(Document $root, $path)
    {
        Archive::set($this, 'root_and_path', array('root' => $root, 'path' => $path));

        if (isset($this->data['embeddedsOne'])) {
            foreach ($this->data['embeddedsOne'] as $name => $embedded) {
                $embedded->setRootAndPath($root, $path.'.'.$name);
            }
        }

        if (isset($this->data['embeddedsMany'])) {
            foreach ($this->data['embeddedsMany'] as $name => $embedded) {
                $embedded->setRootAndPath($root, $path.'.'.$name);
            }
        }
    }
public function setRootAndPath ( Document $ root , $ path ) { Archive :: set ( $ this , 'root_and_path' , array ( 'root' => $ root , 'path' => $ path ) ) ; if ( isset ( $ this -> data [ 'embeddedsOne' ] ) ) { foreach ( $ this -> data [ 'embeddedsOne' ] as $ name => $ embedded ) { $ embedded -> setRootAndPath ( $ root , $ path . '.' . $ name ) ; } } if ( isset ( $ this -> data [ 'embeddedsMany' ] ) ) { foreach ( $ this -> data [ 'embeddedsMany' ] as $ name => $ embedded ) { $ embedded -> setRootAndPath ( $ root , $ path . '.' . $ name ) ; } } }
Set the root and path of the embedded document.

@param \Mandango\Document\Document $root The root document.
@param string                      $path The path.

@api
Set the root and path of the embedded document .