From eb7bdb3fbc0a4e42827987b2b90d25dc82be290d Mon Sep 17 00:00:00 2001 From: Sam Georges Date: Wed, 30 Jul 2014 17:23:14 +1000 Subject: [PATCH] Tidy up code. Refs #497 --- modules/backend/formwidgets/DataGrid.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/modules/backend/formwidgets/DataGrid.php b/modules/backend/formwidgets/DataGrid.php index 267b30093..ff4f35f9e 100644 --- a/modules/backend/formwidgets/DataGrid.php +++ b/modules/backend/formwidgets/DataGrid.php @@ -79,9 +79,17 @@ class DataGrid extends FormWidgetBase return $grid; } + /** + * Looks at the model for getXXXAutocompleteValues or getGridAutocompleteValues methods + * to obtain values for autocomplete field types. + * @param string $field Grid field name + * @param string $value Current value + * @param string $data Data for the entire grid + * @return array + */ public function getAutocompleteValues($field, $value, $data) { - $methodName = 'get'.studly_case($this->columnName).'GridAutocompleteValues'; + $methodName = 'get'.studly_case($this->columnName).'AutocompleteValues'; if (!$this->model->methodExists($methodName) && !$this->model->methodExists('getGridAutocompleteValues')) throw new ApplicationException('Model :model does not contain a method getGridAutocompleteValues()'); @@ -97,7 +105,6 @@ class DataGrid extends FormWidgetBase return $result; } - public function getDataSourceValues() { if (!$this->model->methodExists('getGridDataSourceValues'))