OCA\OcSms\Controller\SettingsController::setCountry PHP Method

setCountry() public method

public setCountry ( $country ) : OCP\AppFramework\Http\JSONResponse
$country
return OCP\AppFramework\Http\JSONResponse
    function setCountry($country)
    {
        if (!array_key_exists($country, CountryCodes::$codes)) {
            return new JSONResponse(array("status" => false, "msg" => "Invalid country"), Http::STATUS_BAD_REQUEST);
        }
        $this->configMapper->set("country", $country);
        return new JSONResponse(array("status" => true, "msg" => "OK"));
    }