From aa07c644407467f667caf2bf04eb12dffaaf4f37 Mon Sep 17 00:00:00 2001 From: Matias Griese Date: Wed, 14 Oct 2020 10:37:45 +0300 Subject: [PATCH] Missing method --- .../Common/Flex/Types/Pages/PageIndex.php | 37 ++++++++++++++----- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php b/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php index aa9b6d7d5..fe3f114f7 100644 --- a/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php +++ b/system/src/Grav/Common/Flex/Types/Pages/PageIndex.php @@ -825,6 +825,32 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface return $collection; } + /** + * Creates new collection with only non-modular pages + * + * @return PageCollectionInterface The collection with only non-modular pages + */ + public function pages() + { + /** @var PageCollectionInterface $collection */ + $collection = $this->__call('pages', []); + + return $collection; + } + + /** + * Creates new collection with only modular pages + * + * @return PageCollectionInterface The collection with only modular pages + */ + public function modules() + { + /** @var PageCollectionInterface $collection */ + $collection = $this->__call('modules', []); + + return $collection; + } + /** * Creates new collection with only modular pages * @@ -832,10 +858,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface */ public function modular() { - /** @var PageCollectionInterface $collection */ - $collection = $this->__call('modular', []); - - return $collection; + return $this->modules(); } /** @@ -845,11 +868,7 @@ class PageIndex extends FlexPageIndex implements PageCollectionInterface */ public function nonModular() { - /** @var PageCollectionInterface $collection */ - $collection = $this->__call('nonModular', []); - - return $collection; - + return $this->pages(); } /**