FormCollectionInterface

public interface FormCollectionInterface

Use this class when you want to deal on multiple forms all at once.

Methods

addForm

void addForm(InnerFormInterface form)

Add a form into the collection.

Parameters:
  • form
Throws:

getForm

InnerFormInterface getForm(String identifier)

Get a form in the collection by its identifier.

Parameters:
  • identifier
Throws:

getValidator

ValidatorInterface getValidator()

The validator this collection will be using to validate the inner forms.

This is basically a parent validator which calls the individual validators bound to each of the inner forms.

isValid

boolean isValid()

Entry point for validation of all the innerforms on this collection.

Runs validation for each of the inner forms.

removeForm

void removeForm(InnerFormInterface form)

REmove a from the collection.

Parameters:
  • form

save

boolean save()

The entry point of form saving.

This method calls the save() of each innerform attached to this collection

Wrap this method in a transaction to ensure if any of the inner form fails to save, All the other innerforms arent saved. for consistency sake.

Throws: