I try to add a field in the 'VirtualMachine' class, and to activate a calculation on this field. I wrote my php function in my main.{my-extension}.php file, but the function (OnUpdate) doesn't overide the 'standard' OnUpdate function. If I try to call my embedding class 'VirtualMachine' the setup hangs because this class already exists, and I don't see a way to 'extends' VirtualMachine on VirtualMachine. This is probably just my poor PHP understanding ?
Any help very welcome 😊
TIA,
Pascal
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thanks for your answer, I had also that feeling. So, in that case, if I redefine 'UnUpdate' for VirtualMachine, and another extension does the same, one of us will loose…
Hi,
I must be totally blind today, but, following (more or less) this tutorial :
https://www.itophub.io/wiki/page?id=2_7_0:customization:cascade-update
I try to add a field in the 'VirtualMachine' class, and to activate a calculation on this field. I wrote my php function in my main.{my-extension}.php file, but the function (OnUpdate) doesn't overide the 'standard' OnUpdate function. If I try to call my embedding class 'VirtualMachine' the setup hangs because this class already exists, and I don't see a way to 'extends' VirtualMachine on VirtualMachine. This is probably just my poor PHP understanding ?
Any help very welcome 😊
TIA,
Pascal
You'd need to do it using XML; and then override the method in one of the XML nodes ;)
Hi Jeffrey,
Thanks for your answer, I had also that feeling. So, in that case, if I redefine 'UnUpdate' for VirtualMachine, and another extension does the same, one of us will loose…
That's probably at least one of the reasons behind the 'CRUD events' who starts with iTop 3.1: https://www.itophub.io/wiki/page?id=3_1_0:customization:extensions_api
But, at the moment, I'm stuck with iTop 2.7
Well, it should do the job…
Thanks again,
Pascal