<!-- saved from url=(0026)http://www.naturaldocs.org -->
<divid=Content><divclass="CClass"><divclass=CTopicid=MainTopic><h1class=CTitle><aname="mxCodecRegistry"></a>mxCodecRegistry</h1><divclass=CBody><p>A class to register codecs for objects.</p><!--START_ND_SUMMARY--><divclass=Summary><divclass=STitle>Summary</div><divclass=SBorder><tableborder=0cellspacing=0cellpadding=0class=STable><trclass="SMain"><tdclass=SEntry><ahref="#mxCodecRegistry">mxCodecRegistry</a></td><tdclass=SDescription>A class to register codecs for objects.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxCodecRegistry.Variables">Variables</a></td><tdclass=SDescription></td></tr><trclass="SVariable SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodecRegistry.codecs"id=link1onMouseOver="ShowTip(event, 'tt1', 'link1')"onMouseOut="HideTip('tt1')">codecs</a></td><tdclass=SDescription>Maps from constructor names to codecs.</td></tr><trclass="SVariable SIndent2"><tdclass=SEntry><ahref="#mxCodecRegistry.aliases"id=link2onMouseOver="ShowTip(event, 'tt2', 'link2')"onMouseOut="HideTip('tt2')">aliases</a></td><tdclass=SDescription>Maps from classnames to codecnames.</td></tr><trclass="SGroup SIndent1"><tdclass=SEntry><ahref="#mxCodecRegistry.Functions">Functions</a></td><tdclass=SDescription></td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodecRegistry.register"id=link3onMouseOver="ShowTip(event, 'tt3', 'link3')"onMouseOut="HideTip('tt3')">register</a></td><tdclass=SDescription>Registers a new codec and associates the name of the template constructor in the codec with the codec object. </td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCodecRegistry.addAlias"id=link4onMouseOver="ShowTip(event, 'tt4', 'link4')"onMouseOut="HideTip('tt4')">addAlias</a></td><tdclass=SDescription>Adds an alias for mapping a classname to a codecname.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodecRegistry.getCodec"id=link5onMouseOver="ShowTip(event, 'tt5', 'link5')"onMouseOut="HideTip('tt5')">getCodec</a></td><tdclass=SDescription>Returns a codec that handles objects that are constructed using the given ctor.</td></tr><trclass="SFunction SIndent2"><tdclass=SEntry><ahref="#mxCodecRegistry.getInstanceForName"id=link6onMouseOver="ShowTip(event, 'tt6', 'link6')"onMouseOut="HideTip('tt6')">getInstanceForName</a></td><tdclass=SDescription>Creates and returns a new instance for the given class name.</td></tr><trclass="SFunction SIndent2 SMarked"><tdclass=SEntry><ahref="#mxCodecRegistry.getName"id=link7onMouseOver="ShowTip(event, 'tt7', 'link7')"onMouseOut="HideTip('tt7')">getName</a></td><tdclass=SDescription>Returns the codec name for the given object instance.</td></tr></table></div></div><!--END_ND_SUMMARY--></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxCodecRegistry.codecs"></a>codecs</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>public static $codecs</td></tr></table></blockquote><p>Maps from constructor names to codecs.</p></div></div></div>
<divclass="CVariable"><divclass=CTopic><h3class=CTitle><aname="mxCodecRegistry.aliases"></a>aliases</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>public static $aliases</td></tr></table></blockquote><p>Maps from classnames to codecnames.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodecRegistry.register"></a>register</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function register(</td><tdclass=PParameternowrap>$codec</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Registers a new codec and associates the name of the template constructor in the codec with the codec object. Automatically creates an alias if the codename and the classname are not equal.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>codec</td><tdclass=CDLDescription><ahref="mxObjectCodec-php.html#mxObjectCodec"class=LClassid=link8onMouseOver="ShowTip(event, 'tt8', 'link8')"onMouseOut="HideTip('tt8')">mxObjectCodec</a> to be registered.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodecRegistry.addAlias"></a>addAlias</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function addAlias(</td><tdclass=PParameternowrap>$classname,</td></tr><tr><td></td><tdclass=PParameternowrap>$codecname</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Adds an alias for mapping a classname to a codecname.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodecRegistry.getCodec"></a>getCodec</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getCodec(</td><tdclass=PParameternowrap>$name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns a codec that handles objects that are constructed using the given ctor.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>ctor</td><tdclass=CDLDescription>JavaScript constructor function.</td></tr></table></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodecRegistry.getInstanceForName"></a>getInstanceForName</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getInstanceForName(</td><tdclass=PParameternowrap>$name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Creates and returns a new instance for the given class name.</p></div></div></div>
<divclass="CFunction"><divclass=CTopic><h3class=CTitle><aname="mxCodecRegistry.getName"></a>getName</h3><divclass=CBody><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getName(</td><tdclass=PParameternowrap>$obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote><p>Returns the codec name for the given object instance.</p><h4class=CHeading>Parameters</h4><tableborder=0cellspacing=0cellpadding=0class=CDescriptionList><tr><tdclass=CDLEntry>obj</td><tdclass=CDLDescription>PHP object to return the codec name for.</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>public static $codecs</td></tr></table></blockquote>Maps from constructor names to codecs.</div></div><divclass=CToolTipid="tt2"><divclass=CVariable><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td>public static $aliases</td></tr></table></blockquote>Maps from classnames to codecnames.</div></div><divclass=CToolTipid="tt3"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function register(</td><tdclass=PParameternowrap>$codec</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Registers a new codec and associates the name of the template constructor in the codec with the codec object. </div></div><divclass=CToolTipid="tt4"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function addAlias(</td><tdclass=PParameternowrap>$classname,</td></tr><tr><td></td><tdclass=PParameternowrap>$codecname</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Adds an alias for mapping a classname to a codecname.</div></div><divclass=CToolTipid="tt5"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getCodec(</td><tdclass=PParameternowrap>$name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns a codec that handles objects that are constructed using the given ctor.</div></div><divclass=CToolTipid="tt6"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getInstanceForName(</td><tdclass=PParameternowrap>$name</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Creates and returns a new instance for the given class name.</div></div><divclass=CToolTipid="tt7"><divclass=CFunction><blockquote><tableborder=0cellspacing=0cellpadding=0class="Prototype prettyprint"><tr><td><tableborder=0cellspacing=0cellpadding=0><tr><tdclass=PBeforeParametersnowrap>static function getName(</td><tdclass=PParameternowrap>$obj</td><tdclass=PAfterParametersnowrap>)</td></tr></table></td></tr></table></blockquote>Returns the codec name for the given object instance.</div></div><divclass=CToolTipid="tt8"><divclass=CClass>XML codec for PHP object graphs.</div></div><!--END_ND_TOOLTIPS-->