Prechádzať zdrojové kódy

Implemented the __isset magic method for the ConnectionParameters class (it is useful to check if a parameter has been set).

Daniele Alessandri 15 rokov pred
rodič
commit
ee739ff843
1 zmenil súbory, kde vykonal 4 pridanie a 0 odobranie
  1. 4 0
      lib/Predis.php

+ 4 - 0
lib/Predis.php

@@ -509,6 +509,10 @@ class ConnectionParameters {
     public function __get($parameter) {
     public function __get($parameter) {
         return $this->_parameters[$parameter];
         return $this->_parameters[$parameter];
     }
     }
+
+    public function __isset($parameter) {
+        return isset($this->_parameters[$parameter]);
+    }
 }
 }
 
 
 interface IConnection {
 interface IConnection {