Pages Parents

Implements page parents helper methods for the $pages API variable and manages the pages_parents DB table.

This is not intended for the public API and instead used internally by the $pages classes, but available at $pages->parents()->methodName() if you want to use anything here.


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

Show $var?     Show args?       Only hookable?    

Common

NameReturnSummary 
$pages->parents->clear($page)
int

Clear page from pages_parents index

 
$pages->parents->delete($page)
int

Delete page entirely from pages_parents table (both as page and parent)

 
$pages->parents->findParentIDs()
array

Find IDs of all pages that are parents for other pages, optionally within a parent

 
$pages->parents->findParents()
array PageArray

Find all pages that have children

 
$pages->parents->getParents($page)
array PageArray

Get parents for given Page and/or specific columns from them

 
$pages->parents->movePage(Page $page, Page $oldParent, Page $newParent)
int

Rebuild pages_parents table for given page (experimental faster alternative/rewrite of rebuild method)

 
$pages->parents->rebuild(Page $page)
int

Rebuild pages_parents table for given page

 
$pages->parents->rebuildAll()
int

Rebuild pages_parents table entirely or from branch starting with a parent branch

 
$pages->parents->rebuildBranch($fromParent)
int

Rebuild pages_parents branch starting at $fromParent and into all descendents

 
$pages->parents->save(Page $page)
int

Check if saved page needs any pages_parents updates and perform them when applicable

 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.252