protected function createDefaultSet()
    {
        $pages = SiteTree::get();
        foreach ($pages as $page) {
            // Only handle valid page types
            if (!$page->config()->get('documents_enabled')) {
                $this->addResult('Skipped: documents disabled');
                continue;
            }

            if ($page->DocumentSets()->count()) {
                // Don't add a set if it already has one
                $this->addResult('Skipped: already has a set');
                continue;
            }
            $this->addDefaultDocumentSet($page);
            $this->addResult('Default document set added');
        }
        return $this;
    }
protected function createDefaultSet()
    {
        $pages = SiteTree::get();
        foreach ($pages as $page) {
            // Only handle valid page types
            if (!$page->config()->get('documents_enabled')) {
                $this->addResult('Skipped: documents disabled');
                continue;
            }

            if ($page->DocumentSets()->count()) {
                // Don't add a set if it already has one
                $this->addResult('Skipped: already has a set');
                continue;
            }
            $this->addDefaultDocumentSet($page);
            $this->addResult('Default document set added');
        }
        return $this;
    }
protected function createDefaultSet ( ) { $ pages = SiteTree :: get ( ) ; foreach ( $ pages as $ page ) { // Only handle valid page types if ( ! $ page -> config ( ) -> get ( 'documents_enabled' ) ) { $ this -> addResult ( 'Skipped: documents disabled' ) ; continue ; } if ( $ page -> DocumentSets ( ) -> count ( ) ) { // Don't add a set if it already has one $ this -> addResult ( 'Skipped: already has a set' ) ; continue ; } $ this -> addDefaultDocumentSet ( $ page ) ; $ this -> addResult ( 'Default document set added' ) ; } return $ this ; }
Creates a default document set for any valid page that doesn't have one

@return $this
Creates a default document set for any valid page that doesn t have one