コード例 #1
0
            return false;
        } else {
            $ratings->addToRatings($id, $newRating);
            print 'Success!';
        }
        break;
    case 'update':
        if (empty($oldRating)) {
            error_log("If you wish to update a previous rating, please specify an oldRating in the parameters.");
            print 'NO OLDRATING SPECIFIED.';
            return false;
        } else {
            if (empty($newRating)) {
                error_log("If you wish to update a previous rating, please specify a newRating in the parameters.");
                print 'NO NEWRATING SPECIFIED.';
                return false;
            } else {
                $ratings->updateRatings($id, $oldRating, $newRating);
                print 'Success!';
            }
        }
        break;
    default:
        error_log("Invalid value for the query parameter.");
        print 'INVALID QUERY';
        return false;
        break;
}
if (!empty($outputcontent)) {
    echo $outputcontent;
}