save filter data in variable

in my code i want to save choosen filter in my variable like i have $status variable and i want to save there this
    protected function getFilters(): ?array
    {
        return [
            null => 'Show All', 
            0 => 'In Progress',
            1 => 'Order',
            2 => 'Completed',
            3 => 'Cancelled',
        ];
    }
if i choose in Progress i want to save 0 in $status
Was this page helpful?