source/Application/Model/Article.php
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]);
        }
    }
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]);
        }
    }
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 ] ) ; } }
Updates variant count. This method is supposed to be called on article change trigger.

@param string $parentId Parent ID
Updates variant count . This method is supposed to be called on article change trigger .