2025/1/5 10:58:22
|
---|
|
get/set functionality for icms_ipf_view_Column classI know this will be much simpler once we can have PHP 8.4 as a baseline, with the get/set functionality there, but we're not there yet I came across the icms_ipf_view_column when testing some modules, and I got an error that the _Param variable was private and couldn't be accessed by the icms_ipf_view_table component. The quick and dirty 'solution' would have been to change the visibility of _param, but that's ugly. I had a look at that column class and came to 2 conclusions :
I'll add the getParam() function, and I'll make the other variables with accessors and underscore names private. That will generate probably lots of errors in IPF, but those need to be cleaned up anyway. The question I have is about the setXXX functions : does a class like icms_ipf_view_column need those? They are easily added, but I won't add them if there is no use case for them. |
_________________
|
2025/1/8 11:47:39
|
---|
|
Re: get/set functionality for icms_ipf_view_Column class
Nevermind - that class doesn't extend any other class. My instinct would be to use a getVar() and setVar() method common to all classes. |
2025/1/8 14:01:33
|
---|
|
Re: get/set functionality for icms_ipf_view_Column classI couldn't find a case where the variables were set after being defined in the constructor, so I've left the set functions out. But a generic getVar could be an improvement, yes. |
_________________
|