source/Application/Model/NewsList.php
public function getCount()
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $sNewsViewName = getViewName('oxnews');
        $oBaseObject = $this->getBaseObject();
        //$sSelectFields = $oBaseObject->getSelectFields();

        if ($oUser = $this->getUser()) {
            // performance - only join if user is logged in
            $sSelect = "select COUNT($sNewsViewName.`oxid`) from $sNewsViewName ";
            $sSelect .= "left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where ";
            $sSelect .= "oxobject2group.oxgroupsid in ( select oxgroupsid from oxobject2group where oxobjectid='" . $oUser->getId() . "' ) or ";
            $sSelect .= "( oxobject2group.oxgroupsid is null ) ";
        } else {
            $sSelect = "select COUNT($sNewsViewName.`oxid`) from $sNewsViewName ";
            $sSelect .= "left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where oxobject2group.oxgroupsid is null ";
        }

        $sSelect .= " and " . $oBaseObject->getSqlActiveSnippet();

        // loading only if there is some data
        $iRecCnt = (int) $oDb->getOne($sSelect);

        return $iRecCnt;
    }
public function getCount()
    {
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();

        $sNewsViewName = getViewName('oxnews');
        $oBaseObject = $this->getBaseObject();
        //$sSelectFields = $oBaseObject->getSelectFields();

        if ($oUser = $this->getUser()) {
            // performance - only join if user is logged in
            $sSelect = "select COUNT($sNewsViewName.`oxid`) from $sNewsViewName ";
            $sSelect .= "left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where ";
            $sSelect .= "oxobject2group.oxgroupsid in ( select oxgroupsid from oxobject2group where oxobjectid='" . $oUser->getId() . "' ) or ";
            $sSelect .= "( oxobject2group.oxgroupsid is null ) ";
        } else {
            $sSelect = "select COUNT($sNewsViewName.`oxid`) from $sNewsViewName ";
            $sSelect .= "left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where oxobject2group.oxgroupsid is null ";
        }

        $sSelect .= " and " . $oBaseObject->getSqlActiveSnippet();

        // loading only if there is some data
        $iRecCnt = (int) $oDb->getOne($sSelect);

        return $iRecCnt;
    }
public function getCount ( ) { $ oDb = \ OxidEsales \ Eshop \ Core \ DatabaseProvider :: getDb ( ) ; $ sNewsViewName = getViewName ( 'oxnews' ) ; $ oBaseObject = $ this -> getBaseObject ( ) ; //$sSelectFields = $oBaseObject->getSelectFields(); if ( $ oUser = $ this -> getUser ( ) ) { // performance - only join if user is logged in $ sSelect = "select COUNT($sNewsViewName.`oxid`) from $sNewsViewName " ; $ sSelect .= "left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where " ; $ sSelect .= "oxobject2group.oxgroupsid in ( select oxgroupsid from oxobject2group where oxobjectid='" . $ oUser -> getId ( ) . "' ) or " ; $ sSelect .= "( oxobject2group.oxgroupsid is null ) " ; } else { $ sSelect = "select COUNT($sNewsViewName.`oxid`) from $sNewsViewName " ; $ sSelect .= "left join oxobject2group on oxobject2group.oxobjectid=$sNewsViewName.oxid where oxobject2group.oxgroupsid is null " ; } $ sSelect .= " and " . $ oBaseObject -> getSqlActiveSnippet ( ) ; // loading only if there is some data $ iRecCnt = ( int ) $ oDb -> getOne ( $ sSelect ) ; return $ iRecCnt ; }
Returns count of all entries.

@return integer $iRecCnt
Returns count of all entries .