FieldtypeOptions class

Field that stores single and multi select options.

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

Show class?             Show args?        

Common

NameReturnSummary 
FieldtypeOptions::addOptions($field, SelectableOptionArray $options)
intAdd the given new options 
FieldtypeOptions::cloneField(Field $field)
FieldReturn a cloned copy of $field
FieldtypeOptions::deleteField(Field $field)
boolDelete the given field
FieldtypeOptions::deleteOptions($field, SelectableOptionArray $options)
intDelete the given options 
FieldtypeOptions::exportConfigData(Field $field, array $data)
arrayExport configuration values for external consumption
FieldtypeOptions::formatValue(Page $page, Field $field, SelectableOptionArray $value)
SelectableOptionArrayPrep a value for front-end output
FieldtypeOptions::get(string $key)
mixed SelectableOptionManagerGet a property from the Fieldtype 
FieldtypeOptions::getBlankValue(Page $page, Field $field)
SelectableOptionArrayGet a blank SelectableOptionArray 
FieldtypeOptions::getCompatibleFieldtypes(Field $field)
FieldtypesGet Fieldtypes that are known compatible with this one
FieldtypeOptions::getConfigInputfields(Field $field)
InputfieldWrapperGet Inputfields needed to configure this Fieldtype
FieldtypeOptions::getDatabaseSchema(Field $field)
arrayGet schema for the Fieldtype's database table 
FieldtypeOptions::getFieldSetups()
arrayGet setup options and setup functions for new fields
FieldtypeOptions::getInputfield(Page $page, Field $field)
InputfieldGet the Inputfield that provides input for this Fieldtype 
FieldtypeOptions::getMatchQuery(PageFinderDatabaseQuerySelect $query, string $table, string $subfield, string $operator, mixed $value)
DatabaseQueryUpdate a database query for finding values from this Fieldtype 
FieldtypeOptions::getOptions($field)
SelectableOptionArrayGet all options available for the given field 
FieldtypeOptions::getSelectorInfo(Field $field)
arrayGet information used for InputfieldSelector interactive selector builder
FieldtypeOptions::importConfigData(Field $field, array $data)
arrayConvert an array of exported data to a format that will be understood internally (opposite of exportConfigData)
FieldtypeOptions::manager SelectableOptionManager 
FieldtypeOptions::markupValue(Page $page, Field $field)
stringRender a markup string of the value
FieldtypeOptions::sanitizeValue(Page $page, Field $field, mixed $value)
SelectableOptionArraySanitize value for storage in a page 
FieldtypeOptions::setOptions($field, SelectableOptionArray $options)
arrayUpdate, add, delete as needed to match the given $options 
FieldtypeOptions::sleepValue(Page $page, Field $field, SelectableOptionArray $value)
arrayPrep value for DB storage
FieldtypeOptions::upgrade(string $fromVersion, string $toVersion)
(nothing)Upgrade module version
FieldtypeOptions::wakeupValue(Page $page, Field $field, array $value)
SelectableOptionArrayPrep value from DB for storage in Page
FieldtypeOptions::wired()
(nothing) 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.244

Latest news

  • ProcessWire Weekly #558
    In the 558th issue of ProcessWire Weekly we'll check out the blog post that introduces ProcessWire 3.0.244, share some recent ProcessWire highlights, and more. Read on!
    Weekly.pw / 18 January 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

I just love the easy and intuitive ProcessWire API. ProcessWire rocks!” —Jens Martsch, Web developer