GTException.php 639 B

123456789101112131415161718192021222324252627
  1. <?php
  2. class GTException extends Exception
  3. {
  4. var $requestId;
  5. //重定义构造器使第一个参数 message 变为必须被指定的属性
  6. public function __construct(){
  7. $a=func_get_args();
  8. $i=func_num_args();
  9. if(method_exists($this,$f='__construct'.$i)){
  10. call_user_func_array(array($this,$f),$a);
  11. }
  12. }
  13. function __construct1($a1){
  14. parent::__construct($a1);
  15. }
  16. function __construct3($a1,$a2,$a3){
  17. parent::__construct($a2,null, $a3);
  18. $this->requestId = $a1;
  19. }
  20. public function getRequestId()
  21. {
  22. return $this->requestId;
  23. }
  24. }