/** * creates and returns singleton instance of class * * @error 14901 * @param null|array|object $options expects optional class options * @return Xapp_Rpc_Smd_Jsonp */ public static function instance($options = null) { if (self::$_instance === null) { self::$_instance = new self($options); } return self::$_instance; }
/** * class constructor sets class options if smd instance is not set in class options * will create smd instance with appropriate options. * * @error 14701 * @param null|array|object $options expects optional options */ public function __construct($options = null) { xapp_set_options($options, $this); if (!xapp_is_option(self::SMD, $this)) { $opt = array(Xapp_Rpc_Smd_Jsonp::TRANSPORT => 'JSONP', Xapp_Rpc_Smd_Jsonp::ENVELOPE => 'URL', Xapp_Rpc_Smd_Jsonp::RELATIVE_TARGETS => false, Xapp_Rpc_Smd_Jsonp::CALLBACK => xapp_get_option(self::CALLBACK, $this)); xapp_set_option(self::SMD, Xapp_Rpc_Smd_Jsonp::instance($opt), $this); } parent::__construct(); }