public function classesToSearch($classes)
    {
        $supportedClasses = array(SiteTree::class, File::class);
        $illegalClasses = array_diff($classes, $supportedClasses);
        if ($illegalClasses) {
            throw new BadMethodCallException(
                "SearchForm::classesToSearch() passed illegal classes '" . implode("', '", $illegalClasses)
                . "'.  At this stage, only File and SiteTree are allowed"
            );
        }
        $legalClasses = array_intersect($classes, $supportedClasses);
        $this->classesToSearch = $legalClasses;
    }
public function classesToSearch($classes)
    {
        $supportedClasses = array(SiteTree::class, File::class);
        $illegalClasses = array_diff($classes, $supportedClasses);
        if ($illegalClasses) {
            throw new BadMethodCallException(
                "SearchForm::classesToSearch() passed illegal classes '" . implode("', '", $illegalClasses)
                . "'.  At this stage, only File and SiteTree are allowed"
            );
        }
        $legalClasses = array_intersect($classes, $supportedClasses);
        $this->classesToSearch = $legalClasses;
    }
public function classesToSearch ( $ classes ) { $ supportedClasses = array ( SiteTree :: class , File :: class ) ; $ illegalClasses = array_diff ( $ classes , $ supportedClasses ) ; if ( $ illegalClasses ) { throw new BadMethodCallException ( "SearchForm::classesToSearch() passed illegal classes '" . implode ( "', '" , $ illegalClasses ) . "'.  At this stage, only File and SiteTree are allowed" ) ; } $ legalClasses = array_intersect ( $ classes , $ supportedClasses ) ; $ this -> classesToSearch = $ legalClasses ; }
Set the classes to search.
Currently you can only choose from "SiteTree" and "File", but a future version might improve this.

@param array $classes
Set the classes to search . Currently you can only choose from SiteTree and File but a future version might improve this .