public static function createFromJSON($json_obj)
 {
     $parent = parent::createFromJSON($json_obj);
     if (!empty($parent->state)) {
         $parent->state = InputControlState::createFromJSON($parent->state);
     }
     return $parent;
 }
Пример #2
0
 /**
  * Update the values of a report's input controls, and obtain the updated input control states as a result
  *
  * @param string $uri
  * @param array $parameters Set of parameters in format: array("id" => array("value"), "id2" => array("value2"));
  * @return array
  */
 public function updateInputControlValues($uri, array $parameters)
 {
     $url = $this->service_url . '/reports' . $uri . '/inputControls/' . join(';', array_keys($parameters)) . '/values';
     $response = $this->service->prepAndSend($url, array(200), 'POST', json_encode($parameters), true);
     $json_obj = json_decode($response);
     $result = array();
     foreach ($json_obj->inputControlState as $state) {
         $result[] = InputControlState::createFromJSON($state);
     }
     return $result;
 }