PHP Modul Dataflow Generator

Hi Fonzo,

Using your PHP Modul Dataflow Generator I get a protected method named SendToIO(string $payload), what is the reson not to use the base class IPSModule ForwardData($JSONString) public method?

Just trying get my head around this.


These are two different things.
SendToIO is just an example, the method that sends the data to the parent instance is SendDataToParent, the data (payload) is send in the buffer to the parent. Of course you could also call the method SendDataToParent in every public method of the PHP module, but perhaps the parameter send to the parent are different so it makes perhaps sense to call another method that sends the data via SendDataToParent and take care that all parts of the buffer are checked and then send to the parent. So this is just a blueprint you can add to SendToIO what you like. Another thing is it is easier to call one method like SendToIO and not call the method SendDataToParent directly from a public method, because in case the GUID changes you have only to correct the GUID in one place and not in all your methods where SendDataToParent is called.

ForwardData is a completly another method. This method is called automaticly in the PHP module if data is coming in via the dataflow from the child. In case data is send from the device to the parent instance (splitter) via SendDataToParent the data is received from the method ForwardData. In ForwardData you can do with the data what you want and then send it further upwards to the IO via also SendDataToParent.

Hope this makes things more clear and not more complicated ;), if not please ask.