protected function _onChangeUpdateVarCount($parentId)
    {
        if ($parentId) {
            $database = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

            $query = "SELECT COUNT(*) AS varcount FROM oxarticles WHERE oxparentid = ?";
            $varCount = (int) $database->getOne($query, [$parentId]);

            $query = "UPDATE oxarticles SET oxvarcount = ? WHERE oxid = ?";
            $database->execute($query, [$varCount, $parentId]);
        }
    }