<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxCodec"></a>mxCodec</h1><divclass=CBody><p>XML codec for PHP object graphs. In order to resolve forward references when reading files the XML document that contains the data must be passed to the constructor.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxCodec">mxCodec</a></td><tdclass=SDescription>XML codec for PHP object graphs. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxCodec.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodec.document"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">document</a></td><tdclass=SDescription>The owner document of the codec.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxCodec.objects"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">objects</a></td><tdclass=SDescription>Maps from IDs to objects.</td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodec.elements"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">elements</a></td><tdclass=SDescription>Maps from IDs to elements.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxCodec.encodeDefaults"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">encodeDefaults</a></td><tdclass=SDescription>Specifies if default values should be encoded. </td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxCodec.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodec.mxGraphViewHtmlReader">mxGraphViewHtmlReader</a></td><tdclass=SDescription>Constructs a new HTML graph view reader.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCodec.putObject"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">putObject</a></td><tdclass=SDescription>Assoiates the given object with the given ID.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodec.getObject"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">getObject</a></td><tdclass=SDescription>Returns the decoded object for the element with the specified ID in <ahref="#mxCodec.document"class=LVariableid=link7onMouseOver="ShowTip(event, 'tt1', 'link7')"onMouseOut="HideTip('tt1')">document</a>. </td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCodec.lookup"id=link8onMouseOver="ShowTip(event, 'tt7', 'link8')"onMouseOut="HideTip('tt7')">lookup</a></td><tdclass=SDescription>Hook for subclassers to implement a custom lookup mechanism for cell IDs. </td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodec.getElementById"id=link9onMouseOver="ShowTip(event, 'tt8', 'link9')"onMouseOut="HideTip('tt8')">getElementById</a></td><tdclass=SDescription>Returns the element with the given ID from <ahref="#mxCodec.document"class=LVariableid=link10onMouseOver="ShowTip(event, 'tt1', 'link10')"onMouseOut="HideTip('tt1')">document</a>.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCodec.addElement"id=link11onMouseOver="ShowTip(event, 'tt9', 'link11')"onMouseOut="HideTip('tt9')">addElement</a></td><tdclass=SDescription>Adds the given element to <ahref="#mxCodec.elements"class=LVariableid=link12onMouseOver="ShowTip(event, 'tt3', 'link12')"onMouseOut="HideTip('tt3')">elements</a> if it has an ID.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodec.getId"id=link13onMouseOver="ShowTip(event, 'tt10', 'link13')"onMouseOut="HideTip('tt10')">getId</a></td><tdclass=SDescription>Returns the ID of the specified object. </td></tr><trclass="SFunction SIndent2"><t
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxCodec.document"></a>document</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $document</td></tr></table></blockquote><p>The owner document of the codec.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxCodec.objects"></a>objects</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $objects</td></tr></table></blockquote><p>Maps from IDs to objects.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxCodec.elements"></a>elements</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $elements</td></tr></table></blockquote><p>Maps from IDs to elements.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxCodec.encodeDefaults"></a>encodeDefaults</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $encodeDefaults</td></tr></table></blockquote><p>Specifies if default values should be encoded. Default is false.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.mxGraphViewHtmlReader"></a>mxGraphViewHtmlReader</h3><divclass=CBody><p>Constructs a new HTML graph view reader.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.putObject"></a>putObject</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function putObject(</td><tdclass=PParameternowrap>$id,</td></tr><tr><td></td><tdclass=PParameternowrap>$object</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Assoiates the given object with the given ID.</p><p>Parameters</p><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>id</td><tdclass=CDLDescription>ID for the object to be associated with.</td></tr><tr><tdclass=CDLEntry>obj</td><tdclass=CDLDescription>Object to be associated with the ID.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.getObject"></a>getObject</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function getObject(</td><tdclass=PParameternowrap>$id</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the decoded object for the element with the specified ID in <ahref="#mxCodec.document"class=LVariableid=link21onMouseOver="ShowTip(event, 'tt1', 'link21')"onMouseOut="HideTip('tt1')">document</a>. If the object is not known then <ahref="#mxCodec.lookup"class=LFunctionid=link22onMouseOver="ShowTip(event, 'tt7', 'link22')"onMouseOut="HideTip('tt7')">lookup</a> is used to find an object. If no object is found, then the element with the respective ID from the document is parsed using <ahref="#mxCodec.decode"class=LFunctionid=link23onMouseOver="ShowTip(event, 'tt13', 'link23')"onMouseOut="HideTip('tt13')">decode</a>.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.lookup"></a>lookup</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function lookup(</td><tdclass=PParameternowrap>$id</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to implement a custom lookup mechanism for cell IDs. This implementation always returns null.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>id</td><tdclass=CDLDescription>ID of the object to be returned.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.getElementById"></a>getElementById</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function getElementById(</td><tdclass=PParameternowrap>$id</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the element with the given ID from <ahref="#mxCodec.document"class=LVariableid=link24onMouseOver="ShowTip(event, 'tt1', 'link24')"onMouseOut="HideTip('tt1')">document</a>.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>id</td><tdclass=CDLDescription>String that contains the ID.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.addElement"></a>addElement</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function addElement(</td><tdclass=PParameternowrap>$node</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds the given element to <ahref="#mxCodec.elements"class=LVariableid=link25onMouseOver="ShowTip(event, 'tt3', 'link25')"onMouseOut="HideTip('tt3')">elements</a> if it has an ID.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.getId"></a>getId</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function getId(</td><tdclass=PParameternowrap>$obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the ID of the specified object. This implementation calls <ahref="#mxCodec.reference"class=LFunctionid=link26onMouseOver="ShowTip(event, 'tt11', 'link26')"onMouseOut="HideTip('tt11')">reference</a> first and if that returns null handles the object as an <ahref="../model/mxCell-php.html#mxCell"class=LClassid=link27onMouseOver="ShowTip(event, 'tt18', 'link27')"onMouseOut="HideTip('tt18')">mxCell</a> by returning their IDs using <ahref="../model/mxCell-php.html#mxCell.getId"class=LFunctionid=link28onMouseOver="ShowTip(event, 'tt19', 'link28')"onMouseOut="HideTip('tt19')">mxCell.getId</a>. If no ID exists for the given cell, then an on-the-fly ID is generated using <ahref="../model/mxCellPath-php.html#mxCellPath.create"class=LFunctionid=link29onMouseOver="ShowTip(event, 'tt20', 'link29')"onMouseOut="HideTip('tt20')">mxCellPath.create</a>.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>obj</td><tdclass=CDLDescription>Object to return the ID for.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.reference"></a>reference</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function reference(</td><tdclass=PParameternowrap>$obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to implement a custom method for retrieving IDs from objects. This implementation always returns null.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>obj</td><tdclass=CDLDescription>Object whose ID should be returned.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.encode"></a>encode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function encode(</td><tdclass=PParameternowrap>$obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Encodes the specified object and returns the resulting XML node.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>obj</td><tdclass=CDLDescription>Object to be encoded.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.decode"></a>decode</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function decode(</td><tdclass=PParameternowrap>$node,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$into</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> null</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodes the given XML node. The optional “into” argument specifies an existing object to be used. If no object is given, then a new instance is created using the constructor from the codec.</p><p>The function returns the passed in object or the new instance if no object was given.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>node</td><tdclass=CDLDescription>XML node to be decoded.</td></tr><tr><tdclass=CDLEntry>into</td><tdclass=CDLDescription>Optional object to be decodec into.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.encodeCell"></a>encodeCell</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function encodeCell(</td><tdclass=PParameternowrap>$cell,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$node,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$includeChildren</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%>true</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Encoding of cell hierarchies is built-into the core, but is a higher-level function that needs to be explicitely used by the respective object encoders (eg. <ahref="mxModelCodec-php.html#mxModelCodec"class=LClassid=link30onMouseOver="ShowTip(event, 'tt21', 'link30')"onMouseOut="HideTip('tt21')">mxModelCodec</a>, <mxChildChangeCodec> and <mxRootChangeCodec>). This implementation writes the given cell and its children as a (flat) sequence into the given node. The children are not encoded if the optional includeChildren is false. The function is in charge of adding the result into the given node and has no return value.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>cell</td><tdclass=CDLDescription><ahref="../model/mxCell-php.html#mxCell"class=LClassid=link31onMouseOver="ShowTip(event, 'tt18', 'link31')"onMouseOut="HideTip('tt18')">mxCell</a> to be encoded.</td></tr><tr><tdclass=CDLEntry>node</td><tdclass=CDLDescription>Parent XML node to add the encoded cell into.</td></tr><tr><tdclass=CDLEntry>includeChildren</td><tdclass=CDLDescription>Optional boolean indicating if the function should include all descendents. Default is true.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.decodeCell"></a>decodeCell</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function decodeCell(</td><tdclass=PParameternowrap>$node,</td><tdclass=PDefaultValuePrefix> </td><tdclass=PDefaultValuewidth=100%></td></tr><tr><td></td><tdclass=PParameternowrap>$restoreStructures</td><tdclass=PDefaultValuePrefix> = </td><tdclass=PDefaultValuewidth=100%> true</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodes cells that have been encoded using inversion, ie. where the user object is the enclosing node in the XML, and restores the group and graph structure in the cells. Returns a new <ahref="../model/mxCell-php.html#mxCell"class=LClassid=link32onMouseOver="ShowTip(event, 'tt18', 'link32')"onMouseOut="HideTip('tt18')">mxCell</a> instance that represents the given node.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>node</td><tdclass=CDLDescription>XML node that contains the cell data.</td></tr><tr><tdclass=CDLEntry>restoreStructures</td><tdclass=CDLDescription>Optional boolean indicating whether the graph structure should be restored by calling insert and insertEdge on the parent and terminals, respectively. Default is true.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.insertIntoGraph"></a>insertIntoGraph</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function insertIntoGraph(</td><tdclass=PParameternowrap>$cell</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Inserts the given cell into its parent and terminal cells.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodec.setAttribute"></a>setAttribute</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function setAttribute(</td><tdclass=PParameternowrap>$node,</td></tr><tr><td></td><tdclass=PParameternowrap>$attribute,</td></tr><tr><td></td><tdclass=PParameternowrap>$value</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the attribute on the specified node to value. This is a helper method that makes sure the attribute and value arguments are not null.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>node</td><tdclass=CDLDescription>XML node to set the attribute for.</td></tr><tr><tdclass=CDLEntry>attributes</td><tdclass=CDLDescription>Attributename to be set.</td></tr><tr><tdclass=CDLEntry>value</td><tdclass=CDLDescription>New value of the attribute.</td></tr></table></div></div></div>
</div><!--Content-->
<divid=Footer><ahref="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
<divclass=CToolTipid="tt1"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $document</td></tr></table></blockquote>The owner document of the codec.</div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $objects</td></tr></table></blockquote>Maps from IDs to objects.</div></div><divclass=CToolTipid="tt3"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $elements</td></tr></table></blockquote>Maps from IDs to elements.</div></div><divclass=CToolTipid="tt4"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>var $encodeDefaults</td></tr></table></blockquote>Specifies if default values should be encoded. </div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function putObject(</td><tdclass=PParameternowrap>$id,</td></tr><tr><td></td><tdclass=PParameternowrap>$object</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Assoiates the given object with the given ID.</div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function getObject(</td><tdclass=PParameternowrap>$id</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the decoded object for the element with the specified ID in document. </div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function lookup(</td><tdclass=PParameternowrap>$id</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to implement a custom lookup mechanism for cell IDs. </div></div><divclass=CToolTipid="tt8"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function getElementById(</td><tdclass=PParameternowrap>$id</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the element with the given ID from document.</div></div><divclass=CToolTipid="tt9"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function addElement(</td><tdclass=PParameternowrap>$node</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Adds the given element to elements if it has an ID.</div></div><divclass=CToolTipid="tt10"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function getId(</td><tdclass=PParameternowrap>$obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the ID of the specified object. </div></div><divclass=CToolTipid="tt11"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>function reference(</td><tdclass=PParameternowrap>$obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to implement a custom method for retrieving IDs from objects. </di