public static function execute_call(Videojuicer_Request $req) { // Do the logic to decide what the components of the HTTP request should be $helper = new Videojuicer_Call_Helper($req); $helper->setup_components(); // Retrieve the values determined $url = $helper->get_url(); $post_vars = $helper->get_post_vars(); $type = $req->get_safe_type(); $file = $req->get_upload_file_path(); // Get the resulting xml(or other data) $data = self::execute_call_curl($url, $req->get_type(), $post_vars, $file); // Convert the xml to the target class $response_class = $req->get_response_class(); Videojuicer_ClassLoader::load($response_class); $result = new $response_class($data); // Return the result return $result; }