From 9f84046bc8113a76c4f09c06f1b8150f8b6274d4 Mon Sep 17 00:00:00 2001 From: Dylan Wagstaff Date: Tue, 26 Nov 2024 03:06:20 +1300 Subject: [PATCH] Update skip write component config get/set name Internally the variables are private, so name isn't a big issue there. Internally to DataObject the method calls are `writeComponents` (called from `write`) and `skipWriteComponents()`, which is why the get/set functions in the EditableColumns component were named that way. However it is a bit confusing, and the variables that are passed can be either boolean, or a configuration array (which isn't very well documented by core)... adding to the confusion. By calling it a "write config" it is a bit clearer the purpose of the function calls and what the author of consuming code intends to happen at that point. This came as feedback on the [original PR][1] [1]: https://github.com/symbiote/silverstripe-gridfieldextensions/pull/350 --- src/GridFieldEditableColumns.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/GridFieldEditableColumns.php b/src/GridFieldEditableColumns.php index 2c522da..3b948f9 100644 --- a/src/GridFieldEditableColumns.php +++ b/src/GridFieldEditableColumns.php @@ -66,7 +66,7 @@ class GridFieldEditableColumns extends GridFieldDataColumns implements /** * @return bool|array */ - public function getSkipWriteComponents() + public function getComponentWriteConfig() { return $this->skipWriteComponents; } @@ -75,7 +75,7 @@ public function getSkipWriteComponents() * @param bool|array $skipConfig * @return $this */ - public function setSkipWriteComponents($skipConfig) + public function setComponentWriteConfig($skipConfig) { $this->skipWriteComponents = $skipConfig; return $this; @@ -187,7 +187,7 @@ public function handleSave(GridField $grid, DataObjectInterface $record) $extra = array_intersect_key($form->getData(), (array) $list->getExtraFields()); } - $item->write(false, false, false, $this->getSkipWriteComponents()); + $item->write(false, false, false, $this->getComponentWriteConfig()); $list->add($item, $extra); } }