SelectableOptionArray class

Located in file /wire/modules/Fieldtype/FieldtypeOptions/SelectableOptionArray.php

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

Show class?             Show args?        

Common

NameReturnSummary 
SelectableOptionArray::addByID(int $id)
false SelectableOptionAdd by option ID 
SelectableOptionArray::addByTitle(string $title)
false SelectableOptionAdd by option title 
SelectableOptionArray::addByValue(string $value)
false SelectableOptionAdd by option value 
SelectableOptionArray::getByID(int $id)
SelectableOption nullGet option by ID 
SelectableOptionArray::getByTitle(string $title)
SelectableOption nullGet option by title 
SelectableOptionArray::getByValue(string $value)
SelectableOption nullGet option by value 
SelectableOptionArray::getField()
null FieldReturns Field object these options are for 
SelectableOptionArray::getItemKey($item)
(nothing) 
SelectableOptionArray::getPage()
NullPage PageReturns page these options are for, if applicable (NullPage otherwise) 
SelectableOptionArray::getProperty(string $property)
mixed nullEnables this WireArray to behave like the first item (for getting properties) 
SelectableOptionArray::hasID(int $id)
SelectableOption boolIs the given id present in these selectable options? 
SelectableOptionArray::hasTitle(string $title)
SelectableOption boolIs the given title present in these selectable options? 
SelectableOptionArray::hasValue(string $value)
SelectableOption boolIs the given value present in these selectable options? 
SelectableOptionArray::id int 
SelectableOptionArray::isIdentical(WireArray $items)
boolIs the given WireArray identical to this one? 
SelectableOptionArray::isValidItem($item)
boolIs the given item valid for storange in this array? 
SelectableOptionArray::isValidKey($key)
boolIs the given item key valid for use in this array? 
SelectableOptionArray::makeBlankItem()
(nothing) 
SelectableOptionArray::of()
boolGet or set output formatting mode 
SelectableOptionArray::removeByID(int $id)
boolRemove option by ID 
SelectableOptionArray::removeByTitle(string $title)
boolRemove option by title 
SelectableOptionArray::removeByValue(string $value)
boolRemove option by value 
SelectableOptionArray::render()
stringProvide a default string rendering of these selectable options 
SelectableOptionArray::set($key, $value)
$thisSet an item by key in the WireArray. 
SelectableOptionArray::setField(Field $field)
(nothing)Set the field these options are for 
SelectableOptionArray::setPage(Page $page)
(nothing)Set the these options live on 
SelectableOptionArray::setProperty(string $property, mixed $value)
SelectableOption SelectableOptionArrayEnables this WireArray to behave like the first item (for setting properties) 
SelectableOptionArray::title string 
SelectableOptionArray::value string 

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.248

Latest news

  • ProcessWire Weekly #582
    The 582nd issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 5 July 2025
  • New ProcessWire admin redesign
    When you upgrade to ProcessWire 3.0.248 or newer (currently the dev branch), you’ll immediately notice something new and beautiful…
    Blog / 9 May 2025
  • Subscribe to weekly ProcessWire news

“We were really happy to build our new portfolio website on ProcessWire! We wanted something that gave us plenty of control on the back-end, without any bloat on the front end - just a nice, easy to access API for all our content that left us free to design and build however we liked.” —Castus, web design agency in Sheffield, UK