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

setContactOrder() public method

public setContactOrder ( $attribute, $reverse ) : OCP\AppFramework\Http\JSONResponse
$attribute
$reverse
return OCP\AppFramework\Http\JSONResponse
    function setContactOrder($attribute, $reverse)
    {
        if (!in_array($reverse, ['true', 'false']) || !in_array($attribute, ['lastmsg', 'label'])) {
            return new JSONResponse(array("status" => false, "msg" => "Invalid contact ordering"), Http::STATUS_BAD_REQUEST);
        }
        $this->configMapper->set("contact_order", $attribute);
        $this->configMapper->set("contact_order_reverse", $reverse);
        return new JSONResponse(array("status" => true, "msg" => "OK"));
    }