Ejemplo n.º 1
0
 /**
  * Makes the api call and returns a collection of job objects
  *
  * @return  \JobApis\Jobs\Client\Collection
  * @throws MissingParameterException
  */
 public function getJobs()
 {
     // Verify that all required query vars are set
     if ($this->query->isValid()) {
         // Get the response from the client using the query
         $response = $this->getClientResponse();
         // Get the response body as a string
         $body = (string) $response->getBody();
         // Parse the string
         $payload = $this->parseAsFormat($body, $this->getFormat());
         // Gets listings if they're nested
         $listings = is_array($payload) ? $this->getRawListings($payload) : [];
         // Return a job collection
         return $this->getJobsCollectionFromListings($listings);
     } else {
         throw new MissingParameterException("All Required parameters for this provider must be set");
     }
 }