Pass the data set along with getOptions methods

This is useful when the model is unreliable, because it is not always populated with the relevant data set. This argument is only needed in edge cases, like when using a repeater or other split class<->data scenarios
Refs #2235
This commit is contained in:
Samuel Georges 2016-07-23 15:16:57 +10:00
parent 675a6a4224
commit c70db75d38

View File

@ -1041,10 +1041,10 @@ class Form extends WidgetBase
}
if ($this->objectMethodExists($model, $methodName)) {
$fieldOptions = $model->$methodName($field->value);
$fieldOptions = $model->$methodName($field->value, $this->data);
}
else {
$fieldOptions = $model->getDropdownOptions($attribute, $field->value);
$fieldOptions = $model->getDropdownOptions($attribute, $field->value, $this->data);
}
}
/*