FieldtypePage class

Field that stores one or more references to ProcessWire pages

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

Show class?             Show args?        

Common

NameReturnSummary 
FieldtypePage::cleanOrphanedReferences()
(nothing)Find and clean orphaned references in each of FieldtypePage's tables 
FieldtypePage::exportConfigData(Field $field, array $data)
arrayExport configuration values for external consumption
FieldtypePage::exportValue(Page $page, Field $field, $value)
array stringExport value
FieldtypePage::findReferences(Page $page)
PageArray array intReturn pages referencing the given $page, optionally indexed by field name 
FieldtypePage::formatValue(Page $page, Field $field, $value)
stringFormat the given value for output.
FieldtypePage::getBlankValue(Page $page, Field $field)
Page PageArray boolReturn either a blank Page or a blank PageArray or boolean false (depending on derefAsPage setting) 
FieldtypePage::getCompatibleFieldtypes(Field $field)
FieldtypesFieldtypePage instances are only compatible with other FieldtypePage derived classes.
FieldtypePage::getConfigInputfields(Field $field)
InputfieldWrapperReturn configuration fields definable for each FieldtypePage
FieldtypePage::getDatabaseSchema(Field $field)
arrayReturn the database schema in predefined format 
FieldtypePage::getFieldClass()
stringGet class name to use Field objects of this type (must be class that extends Field class) 
FieldtypePage::getFieldSetups()
arrayGet setup options and setup functions for new fields
FieldtypePage::getInputfield(Page $page, Field $field)
InputfieldPageReturn an InputfieldPage of the type configured 
FieldtypePage::getLoadQueryAutojoin(Field $field, DatabaseQuerySelect $query)
DatabaseQuerySelect nullReturn the query used for Autojoining this field 
FieldtypePage::getMatchQuery($query, string $table, string $subfield, string $operator, string $value)
DatabaseQueryUpdate a DatabaseQuerySelect object to match a Page 
FieldtypePage::getSelectorInfo(Field $field)
arrayReturn array with information about what properties and operators can be used with this field
FieldtypePage::importConfigData(Field $field, array $data)
arrayConvert an array of exported data to a format that will be understood internally
FieldtypePage::importValue(Page $page, Field $field, $value)
PageArrayImport value
FieldtypePage::isAutoload()
boolWe want FieldtypePage to autoload so that it can monitor page deletes 
FieldtypePage::isEmptyValue(Field $field, $value)
boolReturn whether the given value is considered empty or not. 
FieldtypePage::isValidPage(Page $value, Field $field, Page $forPage)
boolValidate that that $value is a valid Page for this field 
FieldtypePage::markupValue(Page $page, Field $field)
MarkupFieldtype stringRender markup value for field
FieldtypePage::sanitizeValue(Page $page, Field $field, $value)
Page PageArray boolGiven a value of unknown type, return a Page or PageArray (depending on $field->derefAsPage setting) 
FieldtypePage::savePageField(Page $page, Field $field)
boolPer the Fieldtype interface, Save the given Field from the given Page to the database
FieldtypePage::sleepValue(Page $page, Field $field, $value)
arrayGiven an 'awake' value, as set by wakeupValue, convert the value back to a basic type for storage in DB.
FieldtypePage::wakeupValue(Page $page, Field $field, $value)
PageArrayGiven a raw value (value as stored in DB), return the value as it would appear in a Page object

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #560
    In the 560th issue of ProcessWire Weekly we'll check out the latest core updates, cover newly released ProcessWire modules, and more. Read on!
    Weekly.pw / 1 February 2025
  • ProcessWire 3.0.244 new main/master version
    ProcessWire 3.0.244 is our newest main/master/stable version. It's been more than a year in the making and is packed with tons of new features, issue fixes, optimizations and more. This post covers all the details.
    Blog / 18 January 2025
  • 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