protected function getItems(GridField $gridField)
    {
        $gridField->getConfig()->removeComponentsByType('GridFieldPaginator');

        $items = $gridField->getManipulatedList();

        foreach ($gridField->getConfig()->getComponents() as $component) {
            if ($component instanceof GridFieldFilterHeader || $component instanceof GridFieldSortableHeader) {
                $items = $component->getManipulatedData($gridField, $items);
            }
        }

        $arrayList = new ArrayList();

        foreach ($items->limit(null) as $item) {
            if (!$item->hasMethod('canView') || $item->canView()) {
                $arrayList->add($item);
            }
        }

        return $arrayList;
    }
protected function getItems(GridField $gridField)
    {
        $gridField->getConfig()->removeComponentsByType('GridFieldPaginator');

        $items = $gridField->getManipulatedList();

        foreach ($gridField->getConfig()->getComponents() as $component) {
            if ($component instanceof GridFieldFilterHeader || $component instanceof GridFieldSortableHeader) {
                $items = $component->getManipulatedData($gridField, $items);
            }
        }

        $arrayList = new ArrayList();

        foreach ($items->limit(null) as $item) {
            if (!$item->hasMethod('canView') || $item->canView()) {
                $arrayList->add($item);
            }
        }

        return $arrayList;
    }
protected function getItems ( GridField $ gridField ) { $ gridField -> getConfig ( ) -> removeComponentsByType ( 'GridFieldPaginator' ) ; $ items = $ gridField -> getManipulatedList ( ) ; foreach ( $ gridField -> getConfig ( ) -> getComponents ( ) as $ component ) { if ( $ component instanceof GridFieldFilterHeader || $ component instanceof GridFieldSortableHeader ) { $ items = $ component -> getManipulatedData ( $ gridField , $ items ) ; } } $ arrayList = new ArrayList ( ) ; foreach ( $ items -> limit ( null ) as $ item ) { if ( ! $ item -> hasMethod ( 'canView' ) || $ item -> canView ( ) ) { $ arrayList -> add ( $ item ) ; } } return $ arrayList ; }
Helper function to extract the item list out of the GridField.
@param  GridField $gridField
@return SS_list
Helper function to extract the item list out of the GridField .