MetaModels\BackendIntegration\SearchablePages::addPages PHP Method

addPages() public method

Start point for the hook getSearchablePages.
See also: RebuildIndex::run()
See also: Automator::generateSitemap()
public addPages ( array $pages, integer | null $rootPage = null, boolean | null $fromSiteMap = false, string | null $language = null ) : array
$pages array List with all pages.
$rootPage integer | null ID of the root page.
$fromSiteMap boolean | null True when called from sitemap generator, null otherwise.
$language string | null The current language.
return array
    public function addPages($pages, $rootPage = null, $fromSiteMap = false, $language = null)
    {
        // Save the pages.
        $this->foundPages = $pages;
        unset($pages);
        // Run each entry in the config array.
        foreach ($this->configs as $config) {
            $this->getMetaModelsPages($config, $rootPage, $language);
        }
        asort($this->foundPages);
        // Return the new list.
        return $this->foundPages;
    }