FullscreenInteractive\ManyField\ManyField
Synopsis
class ManyField
extends CompositeField
{
- // members
- private static array $allowed_actions = ;
- protected integer $minRecords = 0;
- protected $maxRecords = NULL;
- protected boolean $canAdd = true;
- protected boolean $canRemove = true;
- protected boolean $canSort = true;
- protected boolean $inlineSave = false;
- protected string $template = 'ManyField';
- protected string $addLabel = 'Add';
- protected boolean $ajaxUrl = false;
- protected $manyFieldDataClass;
- protected boolean $callWriteOnNewRow = false;
- protected array $fieldCallbacks = ;
- protected array $manyChildren = ;
- // methods
- public void __construct()
- public void addFieldCallback()
- public $this setMinRecords()
- public int getMinRecords()
- public $this setMaxRecords()
- public int getMaxRecords()
- public $this setInlineSave()
- public int getInlineSave()
- public $this setCanSort()
- public $this setCanRemove()
- public $this setCanAdd()
- public boolean canAdd()
- public boolean canRemove()
- public boolean canSort()
- public string getAddLabel()
- public $this setAddLabel()
- public boolean hasData()
- public $this setCallWriteOnNewRow()
- public $this setLoadFromAjax()
- public string getLoadFromAjax()
- public $this setSubmittedValue()
- public void saveInto()
- public HTML; createNewRecord()
- public HTML; saveRecord()
- public void recordForm()
- public void deleteRecord()
- public ManyField setDataClass()
- public string AddLink()
- public string EditLink()
- public string SaveLink()
- public void setValue()
- public FieldList FieldList()
- protected void updateManyNestedField()
- public CompositeField generateRow()
- public void createPhysicalRecord()
- public void AbsoluteLink()
- public void updateRelation()
Hierarchy
Extends
- SilverStripe\Forms\CompositeField
Members
private
- $allowed_actions
protected
- $addLabel — string
- $ajaxUrl — string
- $callWriteOnNewRow
—
boolean
Does creating a new row automatically call write to the database? - $canAdd — boolean
- $canRemove
—
boolean
Can records be removed from the list - useful for displaying just an inline edit form. - $canSort — boolean
- $fieldCallbacks — array
- $inlineSave — boolean
- $manyChildren
- $manyFieldDataClass — string
- $maxRecords — int
- $minRecords — int
- $template — string
Methods
protected
public
- __construct()
- AbsoluteLink()
- AddLink() — Add URL
- EditLink() — Edit Record Form URL
- FieldList() — Return the list of fields. We'll create a row for each of the values if they exist otherwise we'll only return
- SaveLink() — Save Record Form URL
- addFieldCallback() — A callback to customise a given form field instance. Must take 4 arguments `$field, $index, $manyField, $value`.
- canAdd()
- canRemove()
- canSort()
- createNewRecord() — Creates a new row template and returns it onto the page. As this is a new record we never will have to load anything into it.
- createPhysicalRecord()
- deleteRecord() — Deletes a record
- generateRow() — Generates a unique row of form fields for this ManyField
- getAddLabel()
- getInlineSave()
- getLoadFromAjax()
- getMaxRecords()
- getMinRecords()
- hasData()
- recordForm() — Displays a Form for a particular record.
- saveInto()
- saveRecord() — Saves an individual line item
- setAddLabel()
- setCallWriteOnNewRow()
- setCanAdd()
- setCanRemove()
- setCanSort()
- setDataClass()
- setInlineSave()
- setLoadFromAjax()
- setMaxRecords()
- setMinRecords()
- setSubmittedValue() — Set the field value.
- setValue() — Override set value.
- updateRelation() — Helper for going through all the values in this manymany field and delete or create new records. This method won't be perfect for every case but it'll handle most cases as long as the Field name matches the relation name.