mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
33 lines
643 B
PHP
33 lines
643 B
PHP
<?php
|
|
|
|
/**
|
|
* A list of formfields which allows for iterative processing of nested composite fields
|
|
*/
|
|
class UserFormsFieldList extends FieldList implements UserFormsFieldContainer {
|
|
|
|
public function processNext(EditableFormField $field) {
|
|
$formField = $field->getFormField();
|
|
if(!$formField) {
|
|
return $this;
|
|
}
|
|
|
|
$this->push($formField);
|
|
|
|
if($formField instanceof UserFormsFieldContainer) {
|
|
return $formField->setParent($this);
|
|
}
|
|
|
|
return $this;
|
|
}
|
|
|
|
public function getParent() {
|
|
// Field list does not have a parent
|
|
return null;
|
|
}
|
|
|
|
public function setParent(UserFormsFieldContainer $parent) {
|
|
return $this;
|
|
}
|
|
|
|
}
|