$fieldgroups API variable / Fieldgroups class

Maintains collections of Fieldgroup object instances and represents the `$fieldgroups` API variable.

For full details on all methods available in a Fieldgroup, be sure to also see the WireArray class.


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

Show $var?             Show args?        

Common

NameReturnSummary 
$fieldgroups->clone(Saveable $item)
Fieldgroup falseCreate and return a cloned copy of this item
$fieldgroups->delete($item)
boolDelete the given fieldgroup from the database
$fieldgroups->deleteField(Field $field)
boolDelete the entries in fieldgroups_fields for the given Field 
$fieldgroups->getAll()
FieldgroupsArrayPer WireSaveableItems interface, return all available Fieldgroup instances 
$fieldgroups->getExportData(Fieldgroup $fieldgroup)
arrayExport config data for the given fieldgroup
$fieldgroups->getFieldNames($fieldgroup)
arrayGet all field names used by given fieldgroup 
$fieldgroups->getLookupTable()
stringPer WireSaveableItemsLookup interface, return the name of the table that Fields are linked to Fieldgroups 
$fieldgroups->getNumTemplates(Fieldgroup $fieldgroup)
intGet the number of templates using the given fieldgroup. 
$fieldgroups->getTable()
stringPer WireSaveableItems interface, return the name of the table that Fieldgroup instances are stored in 
$fieldgroups->getTemplates(Fieldgroup $fieldgroup)
TemplatesArrayGiven a Fieldgroup, return a TemplatesArray of all templates using the Fieldgroup 
$fieldgroups->getWireArray()
WireArray FieldgroupsArray@return WireArray|FieldgroupsArray 
$fieldgroups->init()
(nothing)Init 
$fieldgroups->makeBlankItem()
FieldgroupPer WireSaveableItems interface, create a blank instance of a Fieldgroup 
$fieldgroups->save(Saveable $item)
boolSave the Fieldgroup to DB
$fieldgroups->saveContext(Fieldgroup $fieldgroup)
intSave contexts for all fields in the given fieldgroup
$fieldgroups->setImportData(Fieldgroup $fieldgroup, array $data)
arrayGiven an export data array, import it back to the class and return what happened

For hooks

These methods are only useful for hooking and should not be called directly.

Additional methods and properties

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

API reference based on ProcessWire core version 3.0.236

Latest news

  • ProcessWire Weekly #518
    The 518th issue of ProcessWire Weekly brings in all the latest news from the ProcessWire community. Modules, sites, and more. Read on!
    Weekly.pw / 13 April 2024
  • ProFields Table Field with Actions support
    This week we have some updates for the ProFields table field (FieldtypeTable). These updates are primarily focused on adding new tools for the editor to facilitate input and management of content in a table field.
    Blog / 12 April 2024
  • Subscribe to weekly ProcessWire news

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