/** * Returns an instance of the self. * * @remark To support PHP 5.2, this method needs to be defined in each extended class * as in static methods, it is not possible to retrieve the extended class name in a base class in PHP 5.2.x. * @return object */ public static function getInstance($sOptionKey = '') { if (isset(self::$oSelf)) { return self::$oSelf; } $sOptionKey = $sOptionKey ? $sOptionKey : AmazonAutoLinks_Registry::$aOptionKeys['template']; $_sClassName = __CLASS__; self::$oSelf = new $_sClassName($sOptionKey); return self::$oSelf; }