API16:JNode/setParent

出典: Joomla! ドキュメンテーション

目次

Description

Set the parent of a this node

[Edit Descripton]



Syntax

setParent(&$parent)
Parameter Name Default Value Description
&$parent the parent to be setted

Defined in

libraries/joomla/base/node.php

Importing

jimport( 'joomla.base.node' );

Source Body

function setParent(&$parent) 
{
        if ($parent instanceof JNode || is_null($parent)) 
        {
                $hash = spl_object_hash($this);
                if (!is_null($this->_parent)) 
                {
                        unset($this->_parent->children[$hash]);
                }
                if (!is_null($parent)) 
                {
                        $parent->_children[$hash] = & $this;
                }
                $this->_parent = & $parent;
        }
}

[Edit See Also]



Examples

<CodeExamplesForm />



自動更新 2012/05/24 12:30:53