code/ContentPage.php
public function Elements()
    {
        $fcvdo = new \Nblum\FlexibleContent\FlexibleContentVersionedDataObject();
        $defaultStage = $fcvdo->getDefaultStage();
        if (isset($_GET['stage']) && $defaultStage == $_GET['stage'] && \Permission::check('CMS_ACCESS')) {
            $stage = $defaultStage;
        } else {
            $stage = \Nblum\FlexibleContent\FlexibleContentVersionedDataObject::get_live_stage();
        }

        $results = \Nblum\FlexibleContent\FlexibleContentVersionedDataObject::get_by_stage(
            \ContentElement::class,
            $stage
            , [
            'Active' => '1',
            'ParentID' => $this->getField('ID')
        ], [
            'Sort' => 'ASC'
        ]);

        return $results;
    }
public function Elements()
    {
        $fcvdo = new \Nblum\FlexibleContent\FlexibleContentVersionedDataObject();
        $defaultStage = $fcvdo->getDefaultStage();
        if (isset($_GET['stage']) && $defaultStage == $_GET['stage'] && \Permission::check('CMS_ACCESS')) {
            $stage = $defaultStage;
        } else {
            $stage = \Nblum\FlexibleContent\FlexibleContentVersionedDataObject::get_live_stage();
        }

        $results = \Nblum\FlexibleContent\FlexibleContentVersionedDataObject::get_by_stage(
            \ContentElement::class,
            $stage
            , [
            'Active' => '1',
            'ParentID' => $this->getField('ID')
        ], [
            'Sort' => 'ASC'
        ]);

        return $results;
    }
public function Elements ( ) { $ fcvdo = new \ Nblum \ FlexibleContent \ FlexibleContentVersionedDataObject ( ) ; $ defaultStage = $ fcvdo -> getDefaultStage ( ) ; if ( isset ( $ _GET [ 'stage' ] ) && $ defaultStage == $ _GET [ 'stage' ] && \ Permission :: check ( 'CMS_ACCESS' ) ) { $ stage = $ defaultStage ; } else { $ stage = \ Nblum \ FlexibleContent \ FlexibleContentVersionedDataObject :: get_live_stage ( ) ; } $ results = \ Nblum \ FlexibleContent \ FlexibleContentVersionedDataObject :: get_by_stage ( \ ContentElement :: class , $ stage , [ 'Active' => '1' , 'ParentID' => $ this -> getField ( 'ID' ) ] , [ 'Sort' => 'ASC' ] ) ; return $ results ; }
creates List of all rows with content
@return DataList
creates List of all rows with content