Faloude Faloude - 19 days ago 5
PHP Question

SilverStripe updateSettingsFields() through DataExtension

The equivalent of

getCMSFields()
in a
DataExtension
is
updateCMSFields(FieldList $fields)
.

What's the equivalent for editing the settings fields through
getSettingsFields()
, for use in DataExtensions?

non-dataextension example

public function getSettingsFields() {
$fields = parent::getSettingsFields();
$fields->removeByName('visiblity');
return $fields;
}

Answer

getSettingsField has an extend-call on updateSettingsFields, so on your DataExtension, you can make a method public function updateSettingsFields(&$fields){} to update the fields.