protected function _isCategoriesAssigned($aCategoryIds)
    {
        if (empty($aCategoryIds)) {
            return false;
        }

        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $sDiscountIdQuoted = $oDb->quote($this->oxdiscount__oxid->value);

        $sCategoryIds = "(" . implode(",", \OxidEsales\Eshop\Core\DatabaseProvider::getDb()->quoteArray($aCategoryIds)) . ")";
        $sQ = "select 1
                from oxobject2discount
                where oxdiscountid = {$sDiscountIdQuoted} and oxobjectid in {$sCategoryIds} and oxtype = 'oxcategories'";

        return $oDb->getOne($sQ) ? true : false;
    }