Exemple #1
0
 /**
  * creates and returns singleton instance of class
  *
  * @error 14802
  * @param null|array|object $options expects optional class options
  * @return Xapp_Rpc_Smd_Json
  */
 public static function instance($options = null)
 {
     if (self::$_instance === null) {
         self::$_instance = new self($options);
     }
     return self::$_instance;
 }
Exemple #2
0
 /**
  * class constructor will set missing instances of smd, request and response and
  * call parent constructor for class initialization
  *
  * @error 14601
  * @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)) {
         xapp_set_option(self::SMD, Xapp_Rpc_Smd_Json::instance(), $this);
     }
     if (!xapp_is_option(self::REQUEST, $this)) {
         xapp_set_option(self::REQUEST, new Xapp_Rpc_Request_Json(), $this);
     }
     if (!xapp_is_option(self::RESPONSE, $this)) {
         xapp_set_option(self::RESPONSE, new Xapp_Rpc_Response_Json(), $this);
     }
     parent::__construct();
 }