diff options
Diffstat (limited to 'fai_gestion/plugins/CustomTheme/src/View/Helper')
-rw-r--r-- | fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php b/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php index a495973..d483d61 100644 --- a/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php +++ b/fai_gestion/plugins/CustomTheme/src/View/Helper/BakeExtraHelper.php @@ -105,23 +105,18 @@ class BakeExtraHelper extends Helper return $coll->take($takeFields)->toArray(); } - public function filterFieldsOther($fields, $controllerName) { - + public function filterFieldsOther($fields, $controllerName, $foreignKey) { $takeFields = Hash::get($this->_config, "taskParams.$controllerName.index-columns"); if ( $takeFields === NULL ) $takeFields = Hash::get($this->_config, "taskParams.default.index-columns"); - //$filterTypes = ['binary']; // TODO - $rejectFields = ['id']; + $rejectFields = ['id', $foreignKey ]; - $coll = collection($fields); - $coll = $coll->reject(function ($field, $key) use ($rejectFields) { + $coll = collection($fields)->reject(function ($field, $key) use ($rejectFields) { return in_array($field, $rejectFields); }); - return $coll->take($takeFields)->toArray(); } - public function getTitleOpts($controllerName) { if ( ! is_string($controllerName) ) return FALSE; return Hash::get($this->_config, "templateExtra.$controllerName.title"); |