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

Latest news

  • ProcessWire Weekly #547
    In the 547th issue of ProcessWire Weekly we're going to check out the latest core updates, introduce a couple of new modules, and more. Read on!
    Weekly.pw / 2 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