public function request($request, $options = array())
 {
     $data = new Org_Apache_Oodt_Balance_Core_ApplicationDataResponse();
     if ($this->link) {
         // Handle associative array
         if (isset($options['format']) && strtolower($options['format']) == 'assoc') {
             // Execute the request and build a response object
             $result = $this->link->queryAll($request, null, MDB2_FETCHMODE_ASSOC);
         } else {
             // Execute the request and build a response object
             $result = $this->link->queryAll($request, null, MDB2_FETCHMODE_ORDERED);
         }
         if (PEAR::isError($result)) {
             $data->setError($result->getMessage());
             return $data;
         } else {
             // Store the request used to generate the data
             $data->bulkAdd($result);
             // Free the request
             $this->link->free();
             // Return the requested data
             return $data;
         }
     } else {
         $data->setError("Unable to establish connection to data source");
         return $data;
     }
 }
 public function request($request, $options = array())
 {
     $data = new Org_Apache_Oodt_Balance_Core_ApplicationDataResponse();
     if ($this->link) {
         // Handle associative array
         if (isset($options['format']) && strtolower($options['format']) == 'assoc') {
             try {
                 // fetch into an PDOStatement object
                 $stmt = $this->link->queryAll($request);
                 $result = $stmt->fetch(PDO::FETCH_ASSOC);
             } catch (PDOException $e) {
                 $data->setError($e->getMessage());
                 return $data;
             }
         } else {
             try {
                 // fetch into an PDOStatement object
                 $stmt = $this->link->queryAll($request);
                 $result = $stmt->fetch(PDO::FETCH_NUM);
             } catch (PDOException $e) {
                 $data->setError($e->getMessage());
                 return $data;
             }
         }
         // Store the request used to generate the data
         $data->bulkAdd($result);
         // Free the request
         $this->link->free();
         // Return the requested data
         return $data;
     } else {
         $data->setError("Unable to establish connection to data source");
         return $data;
     }
 }