Exemplo n.º 1
0
 /**
  * Simple function to return an array of Participants based on search criteria.
  *
  * @param EWSClient $client
  *   Client.
  * @param array $queries
  *   Array of query arrays for building the query string.
  * @param string $class
  *   Class name of the objects to create with the results.
  * @param string $path
  *   Path to the API.
  *
  * @return array
  */
 public static function searches($client, $queries, $class = '', $path = '')
 {
     $paths = [];
     foreach ($queries as $query) {
         $paths[] = $client->getPath() . $path . "?" . http_build_query($query);
     }
     $results_array = $client->requestJsons('GET', $paths);
     $objects = [];
     foreach ($results_array as $results) {
         foreach ($results['results'] as $result) {
             $objects[] = new $class($client, $result);
         }
     }
     return $objects;
 }