Procházet zdrojové kódy

changePackage - try to get domainId by name

andre před 2 roky
rodič
revize
efa02cd0b6
1 změnil soubory, kde provedl 9 přidání a 7 odebrání
  1. 9 7
      api/KerioWhmcs.php

+ 9 - 7
api/KerioWhmcs.php

@@ -95,18 +95,20 @@ class KerioWhmcs extends KerioConnectApi {
 
 		$params = array(
 			'query' => array(
-				'fields' => 'id',
-				'conditions' => array(
-					'fieldName' => 'name',
-					'comparator' => 'Eq',
-					'value' => $domain
+				'fields' => array(
+					'id',
+					'name'
 				)
 			)
 		);
 
 		$result = $this->sendRequest($method, $params);
-
-		return $result;
+		foreach($result as $key) {
+			if ($key['name'] == $domain) {
+				return $key['id'];
+			}
+		}
+		return FALSE;
 	}
 
 	/**