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.236

Latest news

  • ProcessWire Weekly #550
    In the 550th issue of ProcessWire Weekly we're going to check out the latest core updates, introduce a new third party module called PagefileMetadata, and more. Read on!
    Weekly.pw / 23 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

“The end client and designer love the ease at which they can update the website. Training beyond how to log in wasn’t even necessary since ProcessWire’s default interface is straightforward.” —Jonathan Lahijani