SelectableOptionManager class

Handles management of the fieldtype_options table and related field_[name] table

to assist FieldtypeOptions module.


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

Show class?     Show args?       Only hookable?    

Common

NameReturnSummary 
SelectableOptionManager::addOptions(Field $field, $options)
intAdd the given option titles for $field 
SelectableOptionManager::deleteAllOptionsForField(Field $field)
intDelete all options for given field 
SelectableOptionManager::deleteOptions(Field $field, $options)
intDelete the given options for $field 
SelectableOptionManager::deleteOptionsByID(Field $field, array $ids)
intDelete the given option IDs 
SelectableOptionManager::findOptionsByProperty(Field $field, string $property, string $operator, string $value)
SelectableOptionArrayPerform a partial match on title of options 
SelectableOptionManager::getOptions(Field $field)
SelectableOptionArray SelectableOptionReturn array of current options for $field 
SelectableOptionManager::getOptionsByID(Field $field, array $ids)
SelectableOptionArray SelectableOptionShortcut to get options by ID number 
SelectableOptionManager::getOptionsString(SelectableOptionArray $options)
stringGet the options input string used for 
SelectableOptionManager::getRemovedOptionIDs()
arrayReturn the option IDs found to have been removed from the last setOptions() call. 
SelectableOptionManager::install()
NoneInstall 
SelectableOptionManager::setOptions(Field $field, $options)
arraySet current options for $field, identify and acting on added, deleted, updated options 
SelectableOptionManager::setOptionsString(Field $field, string $value)
arraySet an options string 
SelectableOptionManager::setOptionsStringLanguages(Field $field, array $values)
NoneSet options string, but for each language 
SelectableOptionManager::uninstall()
NoneUninstall 
SelectableOptionManager::updateLanguages()
NoneHook method called when a language is added or deleted 
SelectableOptionManager::updateOptions(Field $field, $options)
intUpdate options for field 
SelectableOptionManager::upgrade(string $fromVersion, string $toVersion)
NoneUpgrade fieldtype_options table 
SelectableOptionManager::useLanguages()
boolWhether or not multi-language support is in use 
SelectableOptionManager::wired()
None 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.251