115 lines
79 KiB
HTML
115 lines
79 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
|
|
|
<html><head><title>mxObjectCodec</title><link rel="stylesheet" type="text/css" href="../../styles/main.css"><script language=JavaScript src="../../javascript/main.js"></script><script language=JavaScript src="../../javascript/prettify.js"></script><script language=JavaScript src="../../javascript/searchdata.js"></script></head><body class="ContentPage" onLoad="NDOnLoad();prettyPrint();"><script language=JavaScript><!--
|
|
if (browserType) {document.write("<div class=" + browserType + ">");if (browserVer) {document.write("<div class=" + browserVer + ">"); }}// --></script>
|
|
|
|
<!-- Generated by Natural Docs, version 1.5 -->
|
|
<!-- http://www.naturaldocs.org -->
|
|
|
|
<!-- saved from url=(0026)http://www.naturaldocs.org -->
|
|
|
|
|
|
|
|
|
|
<div id=Content><div class="CClass"><div class=CTopic id=MainTopic><h1 class=CTitle><a name="mxObjectCodec"></a>mxObjectCodec</h1><div class=CBody><p>XML codec for PHP object graphs.</p><h4 class=CHeading>Implementation note</h4><p>The passing of the argument by reference in <a href="#mxObjectCodec.decode" class=LFunction id=link43 onMouseOver="ShowTip(event, 'tt23', 'link43')" onMouseOut="HideTip('tt23')">decode</a>, <a href="#mxObjectCodec.decodeNode" class=LFunction id=link44 onMouseOver="ShowTip(event, 'tt24', 'link44')" onMouseOut="HideTip('tt24')">decodeNode</a>, <a href="#mxObjectCodec.decodeAttributes" class=LFunction id=link45 onMouseOver="ShowTip(event, 'tt25', 'link45')" onMouseOut="HideTip('tt25')">decodeAttributes</a>, <a href="#mxObjectCodec.decodeAttribute" class=LFunction id=link46 onMouseOver="ShowTip(event, 'tt27', 'link46')" onMouseOut="HideTip('tt27')">decodeAttribute</a>, <a href="#mxObjectCodec.decodeChildren" class=LFunction id=link47 onMouseOver="ShowTip(event, 'tt26', 'link47')" onMouseOut="HideTip('tt26')">decodeChildren</a>, <a href="#mxObjectCodec.decodeChild" class=LFunction id=link48 onMouseOver="ShowTip(event, 'tt28', 'link48')" onMouseOut="HideTip('tt28')">decodeChild</a>, <a href="#mxObjectCodec.beforeDecode" class=LFunction id=link49 onMouseOver="ShowTip(event, 'tt32', 'link49')" onMouseOut="HideTip('tt32')">beforeDecode</a> and <a href="#mxObjectCodec.afterDecode" class=LFunction id=link50 onMouseOver="ShowTip(event, 'tt33', 'link50')" onMouseOut="HideTip('tt33')">afterDecode</a> is required since the object may be an array instance, which needs an explicit reference operator even in PHP 5 to be changed in-place.</p><!--START_ND_SUMMARY--><div class=Summary><div class=STitle>Summary</div><div class=SBorder><table border=0 cellspacing=0 cellpadding=0 class=STable><tr class="SMain"><td class=SEntry><a href="#mxObjectCodec" >mxObjectCodec</a></td><td class=SDescription>XML codec for PHP object graphs.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxObjectCodec.Variables" >Variables</a></td><td class=SDescription></td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.template" id=link1 onMouseOver="ShowTip(event, 'tt1', 'link1')" onMouseOut="HideTip('tt1')">template</a></td><td class=SDescription>Holds the template object associated with this codec.</td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxObjectCodec.exclude" id=link2 onMouseOver="ShowTip(event, 'tt2', 'link2')" onMouseOut="HideTip('tt2')">exclude</a></td><td class=SDescription>Array containing the variable names that should be ignored by the codec.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.idrefs" id=link3 onMouseOver="ShowTip(event, 'tt3', 'link3')" onMouseOut="HideTip('tt3')">idrefs</a></td><td class=SDescription>Array containing the variable names that should be turned into or converted from references. </td></tr><tr class="SVariable SIndent2"><td class=SEntry><a href="#mxObjectCodec.mapping" id=link4 onMouseOver="ShowTip(event, 'tt4', 'link4')" onMouseOut="HideTip('tt4')">mapping</a></td><td class=SDescription>Maps from from fieldnames to XML attribute names.</td></tr><tr class="SVariable SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.reverse" id=link5 onMouseOver="ShowTip(event, 'tt5', 'link5')" onMouseOut="HideTip('tt5')">reverse</a></td><td class=SDescription>Maps from from XML attribute names to fieldnames.</td></tr><tr class="SGroup SIndent1"><td class=SEntry><a href="#mxObjectCodec.Functions" >Functions</a></td><td class=SDescription></td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.mxObjectCodec" id=link6 onMouseOver="ShowTip(event, 'tt6', 'link6')" onMouseOut="HideTip('tt6')">mxObjectCodec</a></td><td class=SDescription>Constructs a new codec for the specified template object. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.getName" id=link7 onMouseOver="ShowTip(event, 'tt7', 'link7')" onMouseOut="HideTip('tt7')">getName</a></td><td class=SDescription>Creates a new instance of the template for this codec.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.cloneTemplate" id=link8 onMouseOver="ShowTip(event, 'tt8', 'link8')" onMouseOut="HideTip('tt8')">cloneTemplate</a></td><td class=SDescription>Creates a new instance of the template for this codec.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.getFieldName" id=link9 onMouseOver="ShowTip(event, 'tt9', 'link9')" onMouseOut="HideTip('tt9')">getFieldName</a></td><td class=SDescription>Returns the fieldname for the given attributename. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.getAttributeName" id=link10 onMouseOver="ShowTip(event, 'tt10', 'link10')" onMouseOut="HideTip('tt10')">getAttributeName</a></td><td class=SDescription>Returns the attributename for the given fieldname. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.isExcluded" id=link11 onMouseOver="ShowTip(event, 'tt11', 'link11')" onMouseOut="HideTip('tt11')">isExcluded</a></td><td class=SDescription>Returns true if the given attribute is to be ignored by the codec. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.isReference" id=link12 onMouseOver="ShowTip(event, 'tt12', 'link12')" onMouseOut="HideTip('tt12')">isReference</a></td><td class=SDescription>Returns true if the given fieldname is to be treated as a textual reference (ID). </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.encode" id=link13 onMouseOver="ShowTip(event, 'tt13', 'link13')" onMouseOut="HideTip('tt13')">encode</a></td><td class=SDescription>Encodes the specified object and returns a node representing then given object. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.encodeObject" id=link14 onMouseOver="ShowTip(event, 'tt14', 'link14')" onMouseOut="HideTip('tt14')">encodeObject</a></td><td class=SDescription>Encodes the value of each member in then given obj into the given node using <a href="#mxObjectCodec.encodeValue" class=LFunction id=link15 onMouseOver="ShowTip(event, 'tt15', 'link15')" onMouseOut="HideTip('tt15')">encodeValue</a>.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.encodeValue" id=link16 onMouseOver="ShowTip(event, 'tt15', 'link16')" onMouseOut="HideTip('tt15')">encodeValue</a></td><td class=SDescription>Converts the given value according to the mappings and id-refs in this codec and uses <a href="#mxObjectCodec.writeAttribute" class=LFunction id=link17 onMouseOver="ShowTip(event, 'tt16', 'link17')" onMouseOut="HideTip('tt16')">writeAttribute</a> to write the attribute into the given node.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.writeAttribute" id=link18 onMouseOver="ShowTip(event, 'tt16', 'link18')" onMouseOut="HideTip('tt16')">writeAttribute</a></td><td class=SDescription>Writes the given value into node using <a href="#mxObjectCodec.writePrimitiveAttribute" class=LFunction id=link19 onMouseOver="ShowTip(event, 'tt17', 'link19')" onMouseOut="HideTip('tt17')">writePrimitiveAttribute</a> or <a href="#mxObjectCodec.writeComplexAttribute" class=LFunction id=link20 onMouseOver="ShowTip(event, 'tt18', 'link20')" onMouseOut="HideTip('tt18')">writeComplexAttribute</a> depending on the type of the value.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.writePrimitiveAttribute" id=link21 onMouseOver="ShowTip(event, 'tt17', 'link21')" onMouseOut="HideTip('tt17')">writePrimitiveAttribute</a></td><td class=SDescription>Writes the given value as an attribute of the given node.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.writeComplexAttribute" id=link22 onMouseOver="ShowTip(event, 'tt18', 'link22')" onMouseOut="HideTip('tt18')">writeComplexAttribute</a></td><td class=SDescription>Writes the given value as a child node of the given node.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.convertValueToXml" id=link23 onMouseOver="ShowTip(event, 'tt19', 'link23')" onMouseOut="HideTip('tt19')">convertValueToXml</a></td><td class=SDescription>Returns the given value without applying a conversion.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.convertValueFromXml" id=link24 onMouseOver="ShowTip(event, 'tt20', 'link24')" onMouseOut="HideTip('tt20')">convertValueFromXml</a></td><td class=SDescription>Returns the given value. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.beforeEncode" id=link25 onMouseOver="ShowTip(event, 'tt21', 'link25')" onMouseOut="HideTip('tt21')">beforeEncode</a></td><td class=SDescription>Hook for subclassers to pre-process the object before encoding. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.afterEncode" id=link26 onMouseOver="ShowTip(event, 'tt22', 'link26')" onMouseOut="HideTip('tt22')">afterEncode</a></td><td class=SDescription>Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.decode" id=link27 onMouseOver="ShowTip(event, 'tt23', 'link27')" onMouseOut="HideTip('tt23')">decode</a></td><td class=SDescription>Parses the given node into the object or returns a new object representing the given node.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.decodeNode" id=link28 onMouseOver="ShowTip(event, 'tt24', 'link28')" onMouseOut="HideTip('tt24')">decodeNode</a></td><td class=SDescription>Calls <a href="#mxObjectCodec.decodeAttributes" class=LFunction id=link29 onMouseOver="ShowTip(event, 'tt25', 'link29')" onMouseOut="HideTip('tt25')">decodeAttributes</a> and <a href="#mxObjectCodec.decodeChildren" class=LFunction id=link30 onMouseOver="ShowTip(event, 'tt26', 'link30')" onMouseOut="HideTip('tt26')">decodeChildren</a> for the given node.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.decodeAttributes" id=link31 onMouseOver="ShowTip(event, 'tt25', 'link31')" onMouseOut="HideTip('tt25')">decodeAttributes</a></td><td class=SDescription>Decodes all attributes of the given node using <a href="#mxObjectCodec.decodeAttribute" class=LFunction id=link32 onMouseOver="ShowTip(event, 'tt27', 'link32')" onMouseOut="HideTip('tt27')">decodeAttribute</a>.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.decodeAttribute" id=link33 onMouseOver="ShowTip(event, 'tt27', 'link33')" onMouseOut="HideTip('tt27')">decodeAttribute</a></td><td class=SDescription>Reads the given attribute into the specified object.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.decodeChildren" id=link34 onMouseOver="ShowTip(event, 'tt26', 'link34')" onMouseOut="HideTip('tt26')">decodeChildren</a></td><td class=SDescription>Decodec all children of the given node using <a href="#mxObjectCodec.decodeChild" class=LFunction id=link35 onMouseOver="ShowTip(event, 'tt28', 'link35')" onMouseOut="HideTip('tt28')">decodeChild</a>.</td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.decodeChild" id=link36 onMouseOver="ShowTip(event, 'tt28', 'link36')" onMouseOut="HideTip('tt28')">decodeChild</a></td><td class=SDescription>Reads the specified child into the given object.</td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.getFieldTemplate" id=link37 onMouseOver="ShowTip(event, 'tt29', 'link37')" onMouseOut="HideTip('tt29')">getFieldTemplate</a></td><td class=SDescription>Returns the template instance for the given field. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.addObjectValue" id=link38 onMouseOver="ShowTip(event, 'tt30', 'link38')" onMouseOut="HideTip('tt30')">addObjectValue</a></td><td class=SDescription>Sets the decoded child node as a value of the given object. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.processInclude" id=link39 onMouseOver="ShowTip(event, 'tt31', 'link39')" onMouseOut="HideTip('tt31')">processInclude</a></td><td class=SDescription>Returns true if the given node is an include directive and executes the include by decoding the XML document. </td></tr><tr class="SFunction SIndent2 SMarked"><td class=SEntry><a href="#mxObjectCodec.beforeDecode" id=link40 onMouseOver="ShowTip(event, 'tt32', 'link40')" onMouseOut="HideTip('tt32')">beforeDecode</a></td><td class=SDescription>Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by <a href="#mxObjectCodec.decode" class=LFunction id=link41 onMouseOver="ShowTip(event, 'tt23', 'link41')" onMouseOut="HideTip('tt23')">decode</a>. </td></tr><tr class="SFunction SIndent2"><td class=SEntry><a href="#mxObjectCodec.afterDecode" id=link42 onMouseOver="ShowTip(event, 'tt33', 'link42')" onMouseOut="HideTip('tt33')">afterDecode</a></td><td class=SDescription>Hook for subclassers to post-process the object after decoding. </td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.Variables"></a>Variables</h3></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.template"></a>template</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $template</td></tr></table></blockquote><p>Holds the template object associated with this codec.</p></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.exclude"></a>exclude</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $exclude</td></tr></table></blockquote><p>Array containing the variable names that should be ignored by the codec.</p></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.idrefs"></a>idrefs</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $idrefs</td></tr></table></blockquote><p>Array containing the variable names that should be turned into or converted from references. See <a href="mxCodec-php.html#mxCodec.getId" class=LFunction id=link51 onMouseOver="ShowTip(event, 'tt34', 'link51')" onMouseOut="HideTip('tt34')">mxCodec.getId</a> and <a href="mxCodec-php.html#mxCodec.getObject" class=LFunction id=link52 onMouseOver="ShowTip(event, 'tt35', 'link52')" onMouseOut="HideTip('tt35')">mxCodec.getObject</a>.</p></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.mapping"></a>mapping</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $mapping</td></tr></table></blockquote><p>Maps from from fieldnames to XML attribute names.</p></div></div></div>
|
|
|
|
<div class="CVariable"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.reverse"></a>reverse</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $reverse</td></tr></table></blockquote><p>Maps from from XML attribute names to fieldnames.</p></div></div></div>
|
|
|
|
<div class="CGroup"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.Functions"></a>Functions</h3></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.mxObjectCodec"></a>mxObjectCodec</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function mxObjectCodec(</td><td class=PParameter nowrap>$template,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PParameter nowrap>$exclude</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> array(),</td></tr><tr><td></td><td class=PParameter nowrap>$idrefs</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> array(),</td></tr><tr><td></td><td class=PParameter nowrap>$mapping</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> array()</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Constructs a new codec for the specified template object. The variables in the optional exclude array are ignored by the codec. Variables in the optional idrefs array are turned into references in the XML. The optional mapping may be used to map from variable names to XML attributes.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>template</td><td class=CDLDescription>Prototypical instance of the object to be encoded/decoded.</td></tr><tr><td class=CDLEntry>exclude</td><td class=CDLDescription>Optional array of fieldnames to be ignored.</td></tr><tr><td class=CDLEntry>idrefs</td><td class=CDLDescription>Optional array of fieldnames to be converted to/from references.</td></tr><tr><td class=CDLEntry>mapping</td><td class=CDLDescription>Optional mapping from field- to attributenames.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.getName"></a>getName</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>function getName()</td></tr></table></blockquote><p>Creates a new instance of the template for this codec.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.cloneTemplate"></a>cloneTemplate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>function cloneTemplate()</td></tr></table></blockquote><p>Creates a new instance of the template for this codec.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.getFieldName"></a>getFieldName</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getFieldName(</td><td class=PParameter nowrap>$attributename</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the fieldname for the given attributename. Looks up the value in the <a href="#mxObjectCodec.reverse" class=LVariable id=link53 onMouseOver="ShowTip(event, 'tt5', 'link53')" onMouseOut="HideTip('tt5')">reverse</a> mapping or returns the input if there is no reverse mapping for the given name.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.getAttributeName"></a>getAttributeName</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getAttributeName(</td><td class=PParameter nowrap>$fieldname</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the attributename for the given fieldname. Looks up the value in the <a href="#mxObjectCodec.mapping" class=LVariable id=link54 onMouseOver="ShowTip(event, 'tt4', 'link54')" onMouseOut="HideTip('tt4')">mapping</a> or returns the input if there is no mapping for the given name.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.isExcluded"></a>isExcluded</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function isExcluded(</td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$write</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given attribute is to be ignored by the codec. This implementation returns true if the given fieldname is in <a href="#mxObjectCodec.exclude" class=LVariable id=link55 onMouseOver="ShowTip(event, 'tt2', 'link55')" onMouseOut="HideTip('tt2')">exclude</a> or if the fieldname equals <mxObjectIdentity.FIELD_NAME>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object instance that contains the field.</td></tr><tr><td class=CDLEntry>attr</td><td class=CDLDescription>Fieldname of the field.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Value of the field.</td></tr><tr><td class=CDLEntry>write</td><td class=CDLDescription>Boolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.isReference"></a>isReference</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function isReference(</td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$write</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given fieldname is to be treated as a textual reference (ID). This implementation returns true if the given fieldname is in <a href="#mxObjectCodec.idrefs" class=LVariable id=link56 onMouseOver="ShowTip(event, 'tt3', 'link56')" onMouseOut="HideTip('tt3')">idrefs</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object instance that contains the field.</td></tr><tr><td class=CDLEntry>attr</td><td class=CDLDescription>Fieldname of the field.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Value of the field.</td></tr><tr><td class=CDLEntry>write</td><td class=CDLDescription>Boolean indicating if the field is being encoded or decoded. Write is true if the field is being encoded, else it is being decoded.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.encode"></a>encode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function encode(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Encodes the specified object and returns a node representing then given object. Calls <a href="#mxObjectCodec.beforeEncode" class=LFunction id=link57 onMouseOver="ShowTip(event, 'tt21', 'link57')" onMouseOut="HideTip('tt21')">beforeEncode</a> after creating the node and <a href="#mxObjectCodec.afterEncode" class=LFunction id=link58 onMouseOver="ShowTip(event, 'tt22', 'link58')" onMouseOut="HideTip('tt22')">afterEncode</a> with the resulting node after processing.</p><p>Enc is a reference to the calling encoder. It is used to encode complex objects and create references.</p><p>This implementation encodes all variables of an object according to the following rules:</p><ul><li>If the variable name is in <a href="#mxObjectCodec.exclude" class=LVariable id=link59 onMouseOver="ShowTip(event, 'tt2', 'link59')" onMouseOut="HideTip('tt2')">exclude</a> then it is ignored.</li><li>If the variable name is in <a href="#mxObjectCodec.idrefs" class=LVariable id=link60 onMouseOver="ShowTip(event, 'tt3', 'link60')" onMouseOut="HideTip('tt3')">idrefs</a> then <a href="mxCodec-php.html#mxCodec.getId" class=LFunction id=link61 onMouseOver="ShowTip(event, 'tt34', 'link61')" onMouseOut="HideTip('tt34')">mxCodec.getId</a> is used to replace the object with its ID.</li><li>The variable name is mapped using <a href="#mxObjectCodec.mapping" class=LVariable id=link62 onMouseOver="ShowTip(event, 'tt4', 'link62')" onMouseOut="HideTip('tt4')">mapping</a>.</li><li>If obj is an array and the variable name is numeric (ie. an index) then it is not encoded.</li><li>If the value is an object, then the codec is used to create a child node with the variable name encoded into the “as” attribute.</li><li>Else, if <encodeDefaults> is true or the value differs from the template value, then ...</li><li>... if obj is not an array, then the value is mapped to an attribute.</li><li>... else if obj is an array, the value is mapped to an add child with a value attribute or a text child node, if the value is a function.</li></ul><p>If no ID exists for a variable in <a href="#mxObjectCodec.idrefs" class=LVariable id=link63 onMouseOver="ShowTip(event, 'tt3', 'link63')" onMouseOut="HideTip('tt3')">idrefs</a> or if an object cannot be encoded, a warning is issued using <a href="../util/mxLog-php.html#mxLog.warn" class=LFunction id=link64 onMouseOver="ShowTip(event, 'tt36', 'link64')" onMouseOut="HideTip('tt36')">mxLog.warn</a>.</p><p>Returns the resulting XML node that represents the given object.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-php.html#mxCodec" class=LClass id=link65 onMouseOver="ShowTip(event, 'tt37', 'link65')" onMouseOut="HideTip('tt37')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to be encoded.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.encodeObject"></a>encodeObject</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function encodeObject(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Encodes the value of each member in then given obj into the given node using <a href="#mxObjectCodec.encodeValue" class=LFunction id=link66 onMouseOver="ShowTip(event, 'tt15', 'link66')" onMouseOut="HideTip('tt15')">encodeValue</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-php.html#mxCodec" class=LClass id=link67 onMouseOver="ShowTip(event, 'tt37', 'link67')" onMouseOut="HideTip('tt37')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to be encoded.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node that contains the encoded object.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.encodeValue"></a>encodeValue</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function encodeValue(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$name,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Converts the given value according to the mappings and id-refs in this codec and uses <a href="#mxObjectCodec.writeAttribute" class=LFunction id=link68 onMouseOver="ShowTip(event, 'tt16', 'link68')" onMouseOut="HideTip('tt16')">writeAttribute</a> to write the attribute into the given node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-php.html#mxCodec" class=LClass id=link69 onMouseOver="ShowTip(event, 'tt37', 'link69')" onMouseOut="HideTip('tt37')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object whose property is going to be encoded.</td></tr><tr><td class=CDLEntry>name</td><td class=CDLDescription>XML node that contains the encoded object.</td></tr><tr><td class=CDLEntry>value</td><td class=CDLDescription>Value of the property to be encoded.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node that contains the encoded object.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.writeAttribute"></a>writeAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function writeAttribute(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Writes the given value into node using <a href="#mxObjectCodec.writePrimitiveAttribute" class=LFunction id=link70 onMouseOver="ShowTip(event, 'tt17', 'link70')" onMouseOut="HideTip('tt17')">writePrimitiveAttribute</a> or <a href="#mxObjectCodec.writeComplexAttribute" class=LFunction id=link71 onMouseOver="ShowTip(event, 'tt18', 'link71')" onMouseOut="HideTip('tt18')">writeComplexAttribute</a> depending on the type of the value.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.writePrimitiveAttribute"></a>writePrimitiveAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function writePrimitiveAttribute(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Writes the given value as an attribute of the given node.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.writeComplexAttribute"></a>writeComplexAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function writeComplexAttribute(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Writes the given value as a child node of the given node.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.convertValueToXml"></a>convertValueToXml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function convertValueToXml(</td><td class=PParameter nowrap>$value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the given value without applying a conversion.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.convertValueFromXml"></a>convertValueFromXml</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function convertValueFromXml(</td><td class=PParameter nowrap>$value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the given value. In PHP there is no need to convert the boolean strings “0” and “1” to their numeric / boolean values.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.beforeEncode"></a>beforeEncode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function beforeEncode(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to pre-process the object before encoding. This returns the input object. The return value of this function is used in <a href="#mxObjectCodec.encode" class=LFunction id=link72 onMouseOver="ShowTip(event, 'tt13', 'link72')" onMouseOut="HideTip('tt13')">encode</a> to perform the default encoding into the given node.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-php.html#mxCodec" class=LClass id=link73 onMouseOver="ShowTip(event, 'tt37', 'link73')" onMouseOut="HideTip('tt37')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to be encoded.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to encode the object into.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.afterEncode"></a>afterEncode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function afterEncode(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node. This implementation returns the input node. The return value of this method is returned to the encoder from <a href="#mxObjectCodec.encode" class=LFunction id=link74 onMouseOver="ShowTip(event, 'tt13', 'link74')" onMouseOut="HideTip('tt13')">encode</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-php.html#mxCodec" class=LClass id=link75 onMouseOver="ShowTip(event, 'tt37', 'link75')" onMouseOut="HideTip('tt37')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to be encoded.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node that represents the default encoding.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decode"></a>decode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decode(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$into</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Parses the given node into the object or returns a new object representing the given node.</p><p>Dec is a reference to the calling decoder. It is used to decode complex objects and resolve references.</p><p>If a node has an id attribute then the object cache is checked for the object. If the object is not yet in the cache then it is constructed using the constructor of <a href="#mxObjectCodec.template" class=LVariable id=link76 onMouseOver="ShowTip(event, 'tt1', 'link76')" onMouseOut="HideTip('tt1')">template</a> and cached in <a href="mxCodec-php.html#mxCodec.objects" class=LVariable id=link77 onMouseOver="ShowTip(event, 'tt38', 'link77')" onMouseOut="HideTip('tt38')">mxCodec.objects</a>.</p><p>This implementation decodes all attributes and childs of a node according to the following rules:</p><ul><li>If the variable name is in <a href="#mxObjectCodec.exclude" class=LVariable id=link78 onMouseOver="ShowTip(event, 'tt2', 'link78')" onMouseOut="HideTip('tt2')">exclude</a> or if the attribute name is “id” or “as” then it is ignored.</li><li>If the variable name is in <a href="#mxObjectCodec.idrefs" class=LVariable id=link79 onMouseOver="ShowTip(event, 'tt3', 'link79')" onMouseOut="HideTip('tt3')">idrefs</a> then <a href="mxCodec-php.html#mxCodec.getObject" class=LFunction id=link80 onMouseOver="ShowTip(event, 'tt35', 'link80')" onMouseOut="HideTip('tt35')">mxCodec.getObject</a> is used to replace the reference with an object.</li><li>The variable name is mapped using a reverse <a href="#mxObjectCodec.mapping" class=LVariable id=link81 onMouseOver="ShowTip(event, 'tt4', 'link81')" onMouseOut="HideTip('tt4')">mapping</a>.</li><li>If the value has a child node, then the codec is used to create a child object with the variable name taken from the “as” attribute.</li><li>If the object is an array and the variable name is empty then the value or child object is appended to the array.</li><li>If an add child has no value or the object is not an array then the child text content is evaluated using <mxUtils.eval>.</li></ul><p>For add nodes where the object is not an array and the variable name is defined, the default mechanism is used, allowing to override/add methods as follows:</p><blockquote><pre class="prettyprint"><Object>
|
|
<add as="hello"><![CDATA[
|
|
function(arg1) {
|
|
alert('Hello '+arg1);
|
|
}
|
|
]]></add>
|
|
</Object></pre></blockquote><p>If no object exists for an ID in <a href="#mxObjectCodec.idrefs" class=LVariable id=link82 onMouseOver="ShowTip(event, 'tt3', 'link82')" onMouseOut="HideTip('tt3')">idrefs</a> a warning is issued using <a href="../util/mxLog-php.html#mxLog.warn" class=LFunction id=link83 onMouseOver="ShowTip(event, 'tt36', 'link83')" onMouseOut="HideTip('tt36')">mxLog.warn</a>.</p><p>Returns the resulting object that represents the given XML node or the object given to the method as the into parameter.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dec</td><td class=CDLDescription><a href="mxCodec-php.html#mxCodec" class=LClass id=link84 onMouseOver="ShowTip(event, 'tt37', 'link84')" onMouseOut="HideTip('tt37')">mxCodec</a> that controls the decoding process.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to be decoded.</td></tr><tr><td class=CDLEntry>into</td><td class=CDLDescription>Optional objec to encode the node into.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeNode"></a>decodeNode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeNode(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Calls <a href="#mxObjectCodec.decodeAttributes" class=LFunction id=link85 onMouseOver="ShowTip(event, 'tt25', 'link85')" onMouseOut="HideTip('tt25')">decodeAttributes</a> and <a href="#mxObjectCodec.decodeChildren" class=LFunction id=link86 onMouseOver="ShowTip(event, 'tt26', 'link86')" onMouseOut="HideTip('tt26')">decodeChildren</a> for the given node.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeAttributes"></a>decodeAttributes</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeAttributes(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodes all attributes of the given node using <a href="#mxObjectCodec.decodeAttribute" class=LFunction id=link87 onMouseOver="ShowTip(event, 'tt27', 'link87')" onMouseOut="HideTip('tt27')">decodeAttribute</a>.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeAttribute"></a>decodeAttribute</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeAttribute(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads the given attribute into the specified object.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeChildren"></a>decodeChildren</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeChildren(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Decodec all children of the given node using <a href="#mxObjectCodec.decodeChild" class=LFunction id=link88 onMouseOver="ShowTip(event, 'tt28', 'link88')" onMouseOut="HideTip('tt28')">decodeChild</a>.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.decodeChild"></a>decodeChild</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeChild(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$child,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Reads the specified child into the given object.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.getFieldTemplate"></a>getFieldTemplate</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getFieldTemplate(</td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$fieldname,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$child</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the template instance for the given field. This returns the value of the field, null if the value is an array or an empty collection if the value is a collection. The value is then used to populate the field for a new instance. For strongly typed languages it may be required to override this to return the correct collection instance based on the encoded child.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.addObjectValue"></a>addObjectValue</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function addObjectValue(</td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$fieldname,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$template</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Sets the decoded child node as a value of the given object. If the object is a map, then the value is added with the given fieldname as a key. If the fieldname is not empty, then setFieldValue is called or else, if the object is a collection, the value is added to the collection. For strongly typed languages it may be required to override this with the correct code to add an entry to an object.</p></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.processInclude"></a>processInclude</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function processInclude(</td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameter nowrap>$into</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns true if the given node is an include directive and executes the include by decoding the XML document. Returns false if the given node is not an include directive.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dec</td><td class=CDLDescription><a href="mxCodec-php.html#mxCodec" class=LClass id=link89 onMouseOver="ShowTip(event, 'tt37', 'link89')" onMouseOut="HideTip('tt37')">mxCodec</a> that controls the encoding/decoding process.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to be checked.</td></tr><tr><td class=CDLEntry>into</td><td class=CDLDescription>Optional object to pass-thru to the codec.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.beforeDecode"></a>beforeDecode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function beforeDecode(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by <a href="#mxObjectCodec.decode" class=LFunction id=link90 onMouseOver="ShowTip(event, 'tt23', 'link90')" onMouseOut="HideTip('tt23')">decode</a>. The object is created based on the template in the calling method and is never null. This implementation returns the input node. The return value of this function is used in <a href="#mxObjectCodec.decode" class=LFunction id=link91 onMouseOver="ShowTip(event, 'tt23', 'link91')" onMouseOut="HideTip('tt23')">decode</a> to perform the default decoding into the given object.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>dec</td><td class=CDLDescription><a href="mxCodec-php.html#mxCodec" class=LClass id=link92 onMouseOver="ShowTip(event, 'tt37', 'link92')" onMouseOut="HideTip('tt37')">mxCodec</a> that controls the decoding process.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to be decoded.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object to encode the node into.</td></tr></table></div></div></div>
|
|
|
|
<div class="CFunction"><div class=CTopic><h3 class=CTitle><a name="mxObjectCodec.afterDecode"></a>afterDecode</h3><div class=CBody><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function afterDecode(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote><p>Hook for subclassers to post-process the object after decoding. This implementation returns the given object without any changes. The return value of this method is returned to the decoder from <a href="#mxObjectCodec.decode" class=LFunction id=link93 onMouseOver="ShowTip(event, 'tt23', 'link93')" onMouseOut="HideTip('tt23')">decode</a>.</p><h4 class=CHeading>Parameters</h4><table border=0 cellspacing=0 cellpadding=0 class=CDescriptionList><tr><td class=CDLEntry>enc</td><td class=CDLDescription><a href="mxCodec-php.html#mxCodec" class=LClass id=link94 onMouseOver="ShowTip(event, 'tt37', 'link94')" onMouseOut="HideTip('tt37')">mxCodec</a> that controls the encoding process.</td></tr><tr><td class=CDLEntry>node</td><td class=CDLDescription>XML node to be decoded.</td></tr><tr><td class=CDLEntry>obj</td><td class=CDLDescription>Object that represents the default decoding.</td></tr></table></div></div></div>
|
|
|
|
</div><!--Content-->
|
|
|
|
|
|
<div id=Footer><a href="http://www.naturaldocs.org">Generated by Natural Docs</a></div><!--Footer-->
|
|
|
|
|
|
<div id=Menu><div class=MEntry><div class=MFile><a href="../index-txt.html">API Specification</a></div></div><div class=MEntry><div class=MFile><a href="../canvas/mxGdCanvas-php.html">canvas/<wbr>mxGdCanvas.php</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent1')">Io</a><div class=MGroupContent id=MGroupContent1><div class=MEntry><div class=MFile><a href="mxCellCodec-php.html">mxCellCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxCodec-php.html">mxCodec</a></div></div><div class=MEntry><div class=MFile><a href="mxCodecRegistry-php.html">mxCodecRegistry</a></div></div><div class=MEntry><div class=MFile><a href="mxModelCodec-php.html">mxModelCodec</a></div></div><div class=MEntry><div class=MFile id=MSelected>mxObjectCodec</div></div><div class=MEntry><div class=MFile><a href="mxStylesheetCodec-php.html">mxStylesheetCodec</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent2')">Model</a><div class=MGroupContent id=MGroupContent2><div class=MEntry><div class=MFile><a href="../model/mxCell-php.html">mxCell</a></div></div><div class=MEntry><div class=MFile><a href="../model/mxCellPath-php.html">mxCellPath</a></div></div><div class=MEntry><div class=MFile><a href="../model/mxGeometry-php.html">mxGeometry</a></div></div><div class=MEntry><div class=MFile><a href="../model/mxGraphModel-php.html">mxGraphModel</a></div></div></div></div></div><div class=MEntry><div class=MFile><a href="../reader/mxGraphViewHtmlReader-php.html">mxGraphViewHtmlReader</a></div></div><div class=MEntry><div class=MFile><a href="../reader/mxGraphViewImageReader-php.html">mxGraphViewImageReader</a></div></div><div class=MEntry><div class=MFile><a href="../canvas/mxHtmlCanvas-php.html">mxHtmlCanvas</a></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent3')">Util</a><div class=MGroupContent id=MGroupContent3><div class=MEntry><div class=MFile><a href="../util/mxConstants-php.html">mxConstants</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxEvent-php.html">mxEvent</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxEventObject-php.html">mxEventObject</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxEventSource-php.html">mxEventSource</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxImageBundle-php.html">mxImageBundle</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxLog-php.html">mxLog</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxPoint-php.html">mxPoint</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxRectangle-php.html">mxRectangle</a></div></div><div class=MEntry><div class=MFile><a href="../util/mxUtils-php.html">mxUtils</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent4')">View</a><div class=MGroupContent id=MGroupContent4><div class=MEntry><div class=MFile><a href="../view/mxCellState-php.html">mxCellState</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxConnectionConstraint-php.html">mxConnectionConstraint</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxEdgeStyle-php.html">mxEdgeStyleFunction</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxGraph-php.html">mxGraph</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxGraphView-php.html">mxGraphView</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxPerimeter-php.html">mxPerimeterFunction</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxStyleRegistry-php.html">mxStyleRegistry</a></div></div><div class=MEntry><div class=MFile><a href="../view/mxStylesheet-php.html">mxStylesheet</a></div></div></div></div></div><div class=MEntry><div class=MGroup><a href="javascript:ToggleMenu('MGroupContent5')">Index</a><div class=MGroupContent id=MGroupContent5><div class=MEntry><div class=MIndex><a href="../../index/General.html">Everything</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Classes.html">Classes</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Files.html">Files</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Functions.html">Functions</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Interfaces.html">Interfaces</a></div></div><div class=MEntry><div class=MIndex><a href="../../index/Variables.html">Variables</a></div></div></div></div></div><script type="text/javascript"><!--
|
|
var searchPanel = new SearchPanel("searchPanel", "HTML", "../../search");
|
|
--></script><div id=MSearchPanel class=MSearchPanelInactive><input type=text id=MSearchField value=Search onFocus="searchPanel.OnSearchFieldFocus(true)" onBlur="searchPanel.OnSearchFieldFocus(false)" onKeyUp="searchPanel.OnSearchFieldChange()"><select id=MSearchType onFocus="searchPanel.OnSearchTypeFocus(true)" onBlur="searchPanel.OnSearchTypeFocus(false)" onChange="searchPanel.OnSearchTypeChange()"><option id=MSearchEverything selected value="General">Everything</option><option value="Classes">Classes</option><option value="Files">Files</option><option value="Functions">Functions</option><option value="Interfaces">Interfaces</option><option value="Variables">Variables</option></select></div><script language=JavaScript><!--
|
|
HideAllBut([1, 2, 3], 6);// --></script></div><!--Menu-->
|
|
|
|
|
|
|
|
<!--START_ND_TOOLTIPS-->
|
|
<div class=CToolTip id="tt1"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $template</td></tr></table></blockquote>Holds the template object associated with this codec.</div></div><div class=CToolTip id="tt2"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $exclude</td></tr></table></blockquote>Array containing the variable names that should be ignored by the codec.</div></div><div class=CToolTip id="tt3"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $idrefs</td></tr></table></blockquote>Array containing the variable names that should be turned into or converted from references. </div></div><div class=CToolTip id="tt4"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $mapping</td></tr></table></blockquote>Maps from from fieldnames to XML attribute names.</div></div><div class=CToolTip id="tt5"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $reverse</td></tr></table></blockquote>Maps from from XML attribute names to fieldnames.</div></div><div class=CToolTip id="tt6"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function mxObjectCodec(</td><td class=PParameter nowrap>$template,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PParameter nowrap>$exclude</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> array(),</td></tr><tr><td></td><td class=PParameter nowrap>$idrefs</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> array(),</td></tr><tr><td></td><td class=PParameter nowrap>$mapping</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> array()</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Constructs a new codec for the specified template object. </div></div><div class=CToolTip id="tt7"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>function getName()</td></tr></table></blockquote>Creates a new instance of the template for this codec.</div></div><div class=CToolTip id="tt8"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>function cloneTemplate()</td></tr></table></blockquote>Creates a new instance of the template for this codec.</div></div><div class=CToolTip id="tt9"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getFieldName(</td><td class=PParameter nowrap>$attributename</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the fieldname for the given attributename. </div></div><div class=CToolTip id="tt10"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getAttributeName(</td><td class=PParameter nowrap>$fieldname</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the attributename for the given fieldname. </div></div><div class=CToolTip id="tt11"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function isExcluded(</td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$write</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the given attribute is to be ignored by the codec. </div></div><div class=CToolTip id="tt12"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function isReference(</td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$write</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the given fieldname is to be treated as a textual reference (ID). </div></div><div class=CToolTip id="tt13"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function encode(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Encodes the specified object and returns a node representing then given object. </div></div><div class=CToolTip id="tt14"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function encodeObject(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Encodes the value of each member in then given obj into the given node using encodeValue.</div></div><div class=CToolTip id="tt15"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function encodeValue(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$name,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Converts the given value according to the mappings and id-refs in this codec and uses writeAttribute to write the attribute into the given node.</div></div><div class=CToolTip id="tt16"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function writeAttribute(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Writes the given value into node using writePrimitiveAttribute or writeComplexAttribute depending on the type of the value.</div></div><div class=CToolTip id="tt17"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function writePrimitiveAttribute(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Writes the given value as an attribute of the given node.</div></div><div class=CToolTip id="tt18"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function writeComplexAttribute(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Writes the given value as a child node of the given node.</div></div><div class=CToolTip id="tt19"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function convertValueToXml(</td><td class=PParameter nowrap>$value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the given value without applying a conversion.</div></div><div class=CToolTip id="tt20"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function convertValueFromXml(</td><td class=PParameter nowrap>$value</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the given value. </div></div><div class=CToolTip id="tt21"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function beforeEncode(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to pre-process the object before encoding. </div></div><div class=CToolTip id="tt22"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function afterEncode(</td><td class=PParameter nowrap>$enc,</td></tr><tr><td></td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameter nowrap>$node</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to post-process the node for the given object after encoding and return the post-processed node. </div></div><div class=CToolTip id="tt23"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decode(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td><td class=PDefaultValuePrefix> </td><td class=PDefaultValue width=100%></td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$into</td><td class=PDefaultValuePrefix> = </td><td class=PDefaultValue width=100%> null</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Parses the given node into the object or returns a new object representing the given node.</div></div><div class=CToolTip id="tt24"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeNode(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Calls decodeAttributes and decodeChildren for the given node.</div></div><div class=CToolTip id="tt25"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeAttributes(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Decodes all attributes of the given node using decodeAttribute.</div></div><div class=CToolTip id="tt26"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeChildren(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Decodec all children of the given node using decodeChild.</div></div><div class=CToolTip id="tt27"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeAttribute(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$attr,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Reads the given attribute into the specified object.</div></div><div class=CToolTip id="tt28"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function decodeChild(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$child,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Reads the specified child into the given object.</div></div><div class=CToolTip id="tt29"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getFieldTemplate(</td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$fieldname,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$child</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the template instance for the given field. </div></div><div class=CToolTip id="tt30"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function addObjectValue(</td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$fieldname,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$value,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$template</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Sets the decoded child node as a value of the given object. </div></div><div class=CToolTip id="tt31"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function processInclude(</td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameter nowrap>$into</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns true if the given node is an include directive and executes the include by decoding the XML document. </div></div><div class=CToolTip id="tt32"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function beforeDecode(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to pre-process the node for the specified object and return the node to be used for further processing by decode. </div></div><div class=CToolTip id="tt33"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function afterDecode(</td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$dec,</td></tr><tr><td></td><td class=PParameterPrefix nowrap></td><td class=PParameter nowrap>$node,</td></tr><tr><td></td><td class=PParameterPrefix nowrap>&</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Hook for subclassers to post-process the object after decoding. </div></div><div class=CToolTip id="tt34"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getId(</td><td class=PParameter nowrap>$obj</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the ID of the specified object. </div></div><div class=CToolTip id="tt35"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>function getObject(</td><td class=PParameter nowrap>$id</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Returns the decoded object for the element with the specified ID in document. </div></div><div class=CToolTip id="tt36"><div class=CFunction><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td><table border=0 cellspacing=0 cellpadding=0><tr><td class=PBeforeParameters nowrap>static function warn(</td><td class=PParameter nowrap>$text</td><td class=PAfterParameters nowrap>)</td></tr></table></td></tr></table></blockquote>Logs a warn trace.</div></div><div class=CToolTip id="tt37"><div class=CClass>XML codec for PHP object graphs. </div></div><div class=CToolTip id="tt38"><div class=CVariable><blockquote><table border=0 cellspacing=0 cellpadding=0 class="Prototype prettyprint"><tr><td>var $objects</td></tr></table></blockquote>Maps from IDs to objects.</div></div><!--END_ND_TOOLTIPS-->
|
|
|
|
|
|
|
|
|
|
<div id=MSearchResultsWindow><iframe src="" frameborder=0 name=MSearchResults id=MSearchResults></iframe><a href="javascript:searchPanel.CloseResultsWindow()" id=MSearchResultsWindowClose>Close</a></div>
|
|
|
|
|
|
<script language=JavaScript><!--
|
|
if (browserType) {if (browserVer) {document.write("</div>"); }document.write("</div>");}// --></script></body></html> |