PageFinder class

Located in file /wire/core/PageFinder.php

Click any linked item for full usage details and examples. Hookable methods are indicated with the icon. In addition to those shown below, the PageFinder class also inherits all the methods and properties of: Wire.

Show class?             Show args?        

Common

NameReturnSummary 
PageFinder::checkAccess bool 
PageFinder::count($selectors)
intReturn a count of pages that match 
PageFinder::find($selectors)
array DatabaseQuerySelectReturn all pages matching the given selector.
PageFinder::findIDs($selectors)
arraySame as find() but returns just a simple array of page IDs without any other info 
PageFinder::findParentIDs($selectors)
arraySame as findIDs() but returns the parent IDs of the pages that matched 
PageFinder::findTemplateIDs($selectors)
arrayFind template ID for each page — returns array of template IDs indexed by page ID 
PageFinder::findVerboseIDs($selectors)
array DatabaseQuerySelectReturns array of arrays with all columns in pages table indexed by page ID 
PageFinder::getLimit()
intReturns the limit placed upon the last find() operation, or 0 if no limit was specified 
PageFinder::getOptions()
arrayReturn array of the options provided to PageFinder, as well as those determined at runtime 
PageFinder::getPageArrayData()
arrayGet data that should be populated back to any resulting PageArray’s data() method 
PageFinder::getParentID()
intReturns the parent ID, if it was part of the selector 
PageFinder::getQuery($selectors, array $options)
DatabaseQuerySelect
PageFinder::getQueryAllowedTemplatesWhere(DatabaseQuerySelect $query, $where)
string
PageFinder::getQueryJoinPath(DatabaseQuerySelect $query, $selector)
(nothing)
PageFinder::getQueryUnknownField($fieldName, array $data)
bool Field;
PageFinder::getStart()
intReturns the start placed upon the last find() operation 
PageFinder::getTemplatesID()
int nullReturns the templates ID, if it was part of the selector 
PageFinder::getTotal()
intReturns the total number of results returned from the last find() operation 
PageFinder::includeMode string 
PageFinder::syntaxError(string $message)
(nothing)Throw a fatal syntax error 

Additional methods and properties

In addition to the methods and properties above, PageFinder also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #547
    In the 547th issue of ProcessWire Weekly we're going to check out the latest core updates, introduce a couple of new modules, and more. Read on!
    Weekly.pw / 2 November 2024
  • Custom Fields Module
    This week we look at a new ProFields module named Custom Fields. This module provides a way to rapidly build out ProcessWire fields that contain any number of subfields/properties within them.
    Blog / 30 August 2024
  • Subscribe to weekly ProcessWire news

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits