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);
    }