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

setNotificationState() public method

public setNotificationState ( $notification ) : OCP\AppFramework\Http\JSONResponse
$notification
return OCP\AppFramework\Http\JSONResponse
    function setNotificationState($notification)
    {
        if (!is_numeric($notification) || $notification < 0 || $notification > 2) {
            return new JSONResponse(array("status" => false, "msg" => "Invalid notification state"), Http::STATUS_BAD_REQUEST);
        }
        $this->configMapper->set("notification_state", $notification);
        return new JSONResponse(array("status" => true, "msg" => "OK"));
    }