You are here

public function FormAssemblyRequest::processResponses in FormAssembly 7

process responses property into forms array

File

includes/FormAssemblyRequest.php, line 283
Authorizes the current site and handles API requests to FormAssembly.

Class

FormAssemblyRequest
@file Authorizes the current site and handles API requests to FormAssembly.

Code

public function processResponses() {
  if (!empty($this->responses)) {
    $forms = array();
    foreach ($this->responses as $response_array) {
      if (!empty($response_array['Forms'])) {
        $forms = array_merge($forms, $response_array['Forms']);
      }
      if (!empty($response_array['Category'])) {
        $this
          ->extractCategories($forms, $response_array['Category']);
      }
    }
    $this->forms = $forms;
  }
}