code/CMSBatchActionHandler.php
protected function getPages($ids)
    {
        // Check empty set
        if (empty($ids)) {
            return new ArrayList();
        }

        $recordClass = $this->recordClass;

        // Bypass translatable filter
        if (class_exists('Translatable') && $recordClass::has_extension('Translatable')) {
            Translatable::disable_locale_filter();
        }

        // Bypass versioned filter
        if ($recordClass::has_extension(Versioned::class)) {
            // Workaround for get_including_deleted not supporting byIDs filter very well
            // Ensure we select both stage / live records
            $pages = Versioned::get_including_deleted($recordClass)->byIDs($ids);
        } else {
            $pages = DataObject::get($recordClass)->byIDs($ids);
        }

        if (class_exists('Translatable') && $recordClass::has_extension('Translatable')) {
            Translatable::enable_locale_filter();
        }

        return $pages;
    }
protected function getPages($ids)
    {
        // Check empty set
        if (empty($ids)) {
            return new ArrayList();
        }

        $recordClass = $this->recordClass;

        // Bypass translatable filter
        if (class_exists('Translatable') && $recordClass::has_extension('Translatable')) {
            Translatable::disable_locale_filter();
        }

        // Bypass versioned filter
        if ($recordClass::has_extension(Versioned::class)) {
            // Workaround for get_including_deleted not supporting byIDs filter very well
            // Ensure we select both stage / live records
            $pages = Versioned::get_including_deleted($recordClass)->byIDs($ids);
        } else {
            $pages = DataObject::get($recordClass)->byIDs($ids);
        }

        if (class_exists('Translatable') && $recordClass::has_extension('Translatable')) {
            Translatable::enable_locale_filter();
        }

        return $pages;
    }
protected function getPages ( $ ids ) { // Check empty set if ( empty ( $ ids ) ) { return new ArrayList ( ) ; } $ recordClass = $ this -> recordClass ; // Bypass translatable filter if ( class_exists ( 'Translatable' ) && $ recordClass :: has_extension ( 'Translatable' ) ) { Translatable :: disable_locale_filter ( ) ; } // Bypass versioned filter if ( $ recordClass :: has_extension ( Versioned :: class ) ) { // Workaround for get_including_deleted not supporting byIDs filter very well // Ensure we select both stage / live records $ pages = Versioned :: get_including_deleted ( $ recordClass ) -> byIDs ( $ ids ) ; } else { $ pages = DataObject :: get ( $ recordClass ) -> byIDs ( $ ids ) ; } if ( class_exists ( 'Translatable' ) && $ recordClass :: has_extension ( 'Translatable' ) ) { Translatable :: enable_locale_filter ( ) ; } return $ pages ; }
Safely query and return all pages queried

@param array $ids
@return SS_List
Safely query and return all pages queried