source/Application/Controller/Admin/AdminListController.php
protected function _calcListItemsCount($sql)
    {
        $stringModifier = getStr();

        // count SQL
        $sql = $stringModifier->preg_replace('/select .* from/i', 'select count(*) from ', $sql);

        // removing order by
        $sql = $stringModifier->preg_replace('/order by .*$/i', '', $sql);

        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        // con of list items which fits current search conditions
        $this->_iListSize = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster()->getOne($sql);

        // set it into session that other frames know about size of DB
        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('iArtCnt', $this->_iListSize);
    }
protected function _calcListItemsCount($sql)
    {
        $stringModifier = getStr();

        // count SQL
        $sql = $stringModifier->preg_replace('/select .* from/i', 'select count(*) from ', $sql);

        // removing order by
        $sql = $stringModifier->preg_replace('/order by .*$/i', '', $sql);

        // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804).
        // con of list items which fits current search conditions
        $this->_iListSize = \OxidEsales\Eshop\Core\DatabaseProvider::getMaster()->getOne($sql);

        // set it into session that other frames know about size of DB
        \OxidEsales\Eshop\Core\Registry::getSession()->setVariable('iArtCnt', $this->_iListSize);
    }
protected function _calcListItemsCount ( $ sql ) { $ stringModifier = getStr ( ) ; // count SQL $ sql = $ stringModifier -> preg_replace ( '/select .* from/i' , 'select count(*) from ' , $ sql ) ; // removing order by $ sql = $ stringModifier -> preg_replace ( '/order by .*$/i' , '' , $ sql ) ; // We force reading from master to prevent issues with slow replications or open transactions (see ESDEV-3804). // con of list items which fits current search conditions $ this -> _iListSize = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getMaster ( ) -> getOne ( $ sql ) ; // set it into session that other frames know about size of DB \ OxidEsales \ Eshop \ Core \ Registry :: getSession ( ) -> setVariable ( 'iArtCnt' , $ this -> _iListSize ) ; }
Calculates list items count

@param string $sql SQL query used co select list items
Calculates list items count