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

“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