public function getList()
    {
        /** @var DataList $list */
        $list = parent::getList();
        if ($this->modelClass === 'News' && class_exists('Subsite') && Subsite::currentSubsiteID() > 0) {
            $pages = NewsHolderPage::get()->filter(array('SubsiteID' => (int)Subsite::currentSubsiteID()));
            $filter = $pages->column('ID');
            /* Manual join needed because otherwise no items are found. Unknown why. */
            $list = $list->innerJoin('NewsHolderPage_Newsitems', 'NewsHolderPage_Newsitems.NewsID = News.ID')
                ->filter(array('NewsHolderPage_Newsitems.NewsHolderPageID' => $filter));
        }

        return $list;
    }
public function getList()
    {
        /** @var DataList $list */
        $list = parent::getList();
        if ($this->modelClass === 'News' && class_exists('Subsite') && Subsite::currentSubsiteID() > 0) {
            $pages = NewsHolderPage::get()->filter(array('SubsiteID' => (int)Subsite::currentSubsiteID()));
            $filter = $pages->column('ID');
            /* Manual join needed because otherwise no items are found. Unknown why. */
            $list = $list->innerJoin('NewsHolderPage_Newsitems', 'NewsHolderPage_Newsitems.NewsID = News.ID')
                ->filter(array('NewsHolderPage_Newsitems.NewsHolderPageID' => $filter));
        }

        return $list;
    }
public function getList ( ) { /** @var DataList $list */ $ list = parent :: getList ( ) ; if ( $ this -> modelClass === 'News' && class_exists ( 'Subsite' ) && Subsite :: currentSubsiteID ( ) > 0 ) { $ pages = NewsHolderPage :: get ( ) -> filter ( array ( 'SubsiteID' => ( int ) Subsite :: currentSubsiteID ( ) ) ) ; $ filter = $ pages -> column ( 'ID' ) ; /* Manual join needed because otherwise no items are found. Unknown why. */ $ list = $ list -> innerJoin ( 'NewsHolderPage_Newsitems' , 'NewsHolderPage_Newsitems.NewsID = News.ID' ) -> filter ( array ( 'NewsHolderPage_Newsitems.NewsHolderPageID' => $ filter ) ) ; } return $ list ; }
List only newsitems from current subsite.

@author Marcio Barrientos
@return ArrayList $list
List only newsitems from current subsite .