I frequently find this method, when I 'search inspiration' in itop base module or complementary extensions :
<methodid="GetRelationQueries"><comment>/**
*Placeholderforbackwardcompatibility(iTop<=2.1.0)
*incaseanextensionattemptstoredefinethisfunction...*/</comment><static>true</static><access>public</access><type>Overload-DBObject</type><code><![CDATA[ public static function GetRelationQueries($sRelCode){return parent::GetRelationQueries($sRelCode);} ]]></code></method>
I must admit, I don't understand the use of this specific function. I don't even fully understand what the parent is in that case.
can somebody explain me that ?
TIA,
Pascal
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Overriding a method just to call its parent seems quite silly.
There are lots of such overrides in the default datamodel, I can't understand why. As Jeffrey said, sure there are some historical reasons behind this...
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
After a little chat with one of Combodo's founder and some git digging : those methods were present before iTop 2.2 as there was no other way to define objects impact relations. In 2.2 was introduced the possibility to define relations in XML - but the methods overrides were left as removing would mean breaking some customizations.
This was announced in the 2.2 migration notes : it's what we now call a depreciation. Second phase of this is removal, and this will be done in 2.8 thanks to your report :)
Thanks Pascal !
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
More seriously, I understand that there is no need to religiously copy this part of code in a contribution who has in it's dependencies 'itop-config-mgmt/2.5.0'
Good for me !
Thanks for this deep research,
Pascal
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I hope that this is a silly question (!)
I frequently find this method, when I 'search inspiration' in itop base module or complementary extensions :
I must admit, I don't understand the use of this specific function. I don't even fully understand what the
parent
is in that case.can somebody explain me that ?
TIA,
Pascal
Parent refers to the parent class of the object for which you find this method.
Impact/depends on was coded differently in the past; so it's more a sort of legacy method for compatibility issues.
Hello,
The GetRelationQueries method is defined in DBObject :
https://github.com/Combodo/iTop/blob/f271606e5e71ffbab752446d7f285ac52f4227b9/core/dbobject.class.php#L4322
Overriding a method just to call its parent seems quite silly.
There are lots of such overrides in the default datamodel, I can't understand why. As Jeffrey said, sure there are some historical reasons behind this...
After a little chat with one of Combodo's founder and some git digging : those methods were present before iTop 2.2 as there was no other way to define objects impact relations. In 2.2 was introduced the possibility to define relations in XML - but the methods overrides were left as removing would mean breaking some customizations.
This was announced in the 2.2 migration notes : it's what we now call a depreciation. Second phase of this is removal, and this will be done in 2.8 thanks to your report :)
Thanks Pascal !
Hi Pierre,
Good if I could help :) :) :)
More seriously, I understand that there is no need to religiously copy this part of code in a contribution who has in it's dependencies 'itop-config-mgmt/2.5.0'
Good for me !
Thanks for this deep research,
Pascal
I can confirm removal was done in 3.0.0-beta :)