/** * Function: register * * 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. * * Parameters: * * codec - <mxObjectCodec> to be registered. */ static function register($codec) { if (isset($codec)) { $name = $codec->getName(); mxCodecRegistry::$codecs[$name] = $codec; $classname = mxCodecRegistry::getName($codec->template); if ($classname != $name) { mxCodecRegistry::addAlias($classname, $name); } } return $codec; }