API16:JNode/setParent
From Joomla! Documentation
< API16:JNode(Difference between revisions)
(New page: ===Description===
Set the parent of a this node
<span class="editsection" style="font-size:76%;">
<nowiki>[</nowiki>Edit Descripton<nowiki>]</nowiki>
...) |
|||
| Line 17: | Line 17: | ||
!Description | !Description | ||
|- | |- | ||
| − | | | + | | &$parent |
| | | | ||
| the parent to be setted | | the parent to be setted | ||
Latest revision as of 05:00, 30 March 2010
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.
Contents |
[edit] Description
Set the parent of a this node
[edit] Syntax
setParent(&$parent)
| Parameter Name | Default Value | Description |
|---|---|---|
| &$parent | the parent to be setted |
[edit] Defined in
libraries/joomla/base/node.php
[edit] Importing
jimport( 'joomla.base.node' );
[edit] 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] SeeAlso:JNode/setParent
[edit] Examples
<CodeExamplesForm />
