Selaa lähdekoodia

variable renombrada

Guillermo Espinoza 8 vuotta sitten
vanhempi
commit
182ba6ba44
1 muutettua tiedostoa jossa 6 lisäystä ja 6 poistoa
  1. 6 6
      Services/Webservice.php

+ 6 - 6
Services/Webservice.php

@@ -21,9 +21,9 @@ class Webservice
     public function getChoices($webservice, $params = array())
     {
         $choices = array();
-        $objectsJson = $this->getArray($webservice, $params);
-        foreach ($objectsJson as $object) {
-            $choices[$object['name']] = $object['id'];
+        $results = $this->getArray($webservice, $params);
+        foreach ($results as $row) {
+            $choices[$row['name']] = $row['id'];
         }
 
         return $choices;
@@ -36,7 +36,7 @@ class Webservice
      */
     public function getArray($webservice, $params = array())
     {
-        $objectsJson = array();
+        $results = array();
         if ($this->serviceContainer->hasParameter($webservice)) {
             $url = $this->serviceContainer->getParameter($webservice);
             $url .= '?filters[qb-criteria]';
@@ -44,13 +44,13 @@ class Webservice
                 $url .= "&filters[{$param}]=$value";
             }
             try {
-                $objectsJson = json_decode(file_get_contents($url), true);
+                $results = json_decode(file_get_contents($url), true);
             } catch (\Exception $ex) {
                 
             }
         }
         
-        return $objectsJson;
+        return $results;
     }
 
     /**