FieldtypeRepeater class

Maintains a collection of fields that are repeated for any number of times.

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

Show class?             Show args?        

Common

NameReturnSummary 
cloneField(Field $field)
FieldCreate a cloned copy of Field
countOldReadyPages(Field $field)
intCount or delete old ready pages that are just taking up space 
deleteField(Field $field)
boolDelete the given field, which implies: drop the table $field->table
deletePageField(Page $page, Field $field)
boolDelete the given Field from the given Page
deleteRepeaterPage(Page $page)
intDelete a repeater page, removing system statuses first 
exportValue(Page $page, Field $field, RepeaterPageArray $value)
arrayExport repeater value
findUnnecessaryParents(Field $field)
PageArrayFind unnecessary parent pages that may be deleted 
formatValue(Page $page, Field $field, PageArray $value)
PageArrayPerform output formatting on the value delivered to the API
getBlankRepeaterPage(Page $page, Field $field)
PageReturns a blank page ready for use as a repeater 
getBlankValue(Page $page, Field $field)
PageArray RepeaterPageArrayGet a blank value of this type, i.e. return a blank PageArray 
getCompatibleFieldtypes(Field $field)
WireArrayFieldtypeRepeater instances are only compatible with other FieldtypeRepeater derived classes.
getConfigAdvancedInputfields(Field $field)
InputfieldWrapperRemove advanced options that aren't supposed with repeaters
getConfigInputfields(Field $field)
InputfieldWrapperReturn configuration fields definable for each FieldtypePage
getCustomPageClass(Field $field)
stringGet custom RepeaterPage class for given repeater field 
getDatabaseSchema(Field $field)
arrayReturn the database schema in predefined format 
getFieldClass()
stringGet class name to use Field objects of this type (must be class that extends Field class) 
getInputfield(Page $page, Field $field)
InputfieldReturn an InputfieldRepeater, ready to be used 
getMatchQuery(PageFinderDatabaseQuerySelect $query, string $table, string $subfield, string $operator, string $value)
PageFinderDatabaseQuerySelectUpdate a DatabaseQuerySelect object to match a Page 
getNextReadyPage(Page $page, Field $field)
PageGet next page ready to be used as a new repeater item, creating it if it doesn't already exist 
getPageArrayClass()
stringGet the class used for repeater PageArray objects 
getPageClass()
stringGet the class used for repeater Page objects 
getRepeaterConfigHelper(Field $field)
FieldtypeRepeaterConfigHelper@param Field $field 
getRepeaterPageParent(Page $page, Field $field)
Page NullPageReturn the parent used by the repeater pages for the given Page and Field 
getRepeaterParent(Field $field)
PageReturn the repeater parent used by $field, i.e. /processwire/repeaters/for-field-123/ 
getRepeatersRootPage()
PageGet repeaters root page 
getSelectorInfo(Field $field)
arrayGet information used by selectors for querying this field
getUniqueRepeaterPageName()
stringReturns a unique name for a repeater page 
importValue(Page $page, Field $field, array $value)
bool PageArrayImport repeater value previously exported by exportValue()
initAllFields()
(nothing)Force initialize of all repeater fields, confirming their configuration settings are correct 
porter()
FieldtypeRepeaterPorter@return FieldtypeRepeaterPorter 
repeatersRootPageID int 
sanitizeValue(Page $page, Field $field, mixed $value)
PageArray RepeaterPageArrayHandles the sanitization and convertion to PageArray value 
sanitizeValueString(Page $page, Field $field, string $value)
Page PageArrayGiven a string value return a Page or PageArray 
savePageField(Page $page, Field $field)
boolSave the given field from page
setCustomPageClass(Field $field, string $class)
(nothing)Set custom RepeaterPage class for given field 
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.
useLazyParents($field)
boolUse lazy parents mode? 
wakeupValue(Page $page, Field $field, array $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, FieldtypeRepeater also inherits the methods and properties of these classes:

API reference based on ProcessWire core version 3.0.244

“To Drupal, or to ProcessWire? The million dollar choice. We decided to make an early switch to PW. And in retrospect, ProcessWire was probably the best decision we made. Thanks are due to ProcessWire and the amazing system and set of modules that are in place.” —Unni Krishnan, Founder of PigtailPundits