private function getIds($controller)
    {
        $ids = $controller->getRequest()->getParam('selected', []);

        if (!is_array($ids)) {
            $ids = [];
        }

        foreach ($ids as $key => &$id) {
            $id = (int) $id;
            if ($id <= 0) {
                unset($ids[$key]);
            }
        }

        return array_unique($ids);
    }
private function getIds($controller)
    {
        $ids = $controller->getRequest()->getParam('selected', []);

        if (!is_array($ids)) {
            $ids = [];
        }

        foreach ($ids as $key => &$id) {
            $id = (int) $id;
            if ($id <= 0) {
                unset($ids[$key]);
            }
        }

        return array_unique($ids);
    }
private function getIds ( $ controller ) { $ ids = $ controller -> getRequest ( ) -> getParam ( 'selected' , [ ] ) ; if ( ! is_array ( $ ids ) ) { $ ids = [ ] ; } foreach ( $ ids as $ key => & $ id ) { $ id = ( int ) $ id ; if ( $ id <= 0 ) { unset ( $ ids [ $ key ] ) ; } } return array_unique ( $ ids ) ; }
Retrieve currently selected Ids.

@param \Magento\Backend\App\Action $controller The controller

@return array
Retrieve currently selected Ids .