Reply New Topic
2025/1/5 10:58:22
#1
Offline
Webmaster

get/set functionality for icms_ipf_view_Column class

I 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 :

  • there is no accessor function - getPäram() - for the _param datafield.
  • there are no set functions whatsoever for those data

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.


_________________

Me on OpenHub


2025/1/8 11:47:39
#2
Offline
Home away from home

Re: get/set functionality for icms_ipf_view_Column class

Are there generic get() and set() functions, either in the current object or the parent? 

Nevermind - that class doesn't extend any other class.

My instinct would be to use a getVar() and setVar() method common to all classes.


_________________
Christian Web Resources
Facebook

2025/1/8 14:01:33
#3
Offline
Webmaster

Re: get/set functionality for icms_ipf_view_Column class

I 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.


_________________

Me on OpenHub


Reply New Topic extras
 Previous Topic   Next Topic
You can view topic.
You can start a new topic.
You can reply to posts.
You cannot edit your posts.
You cannot delete your posts.
You cannot add new polls.
You cannot vote in polls.
You cannot attach files to posts.
You can post without approval.