Details
-
Improvement
-
Resolution: Fixed
-
Medium
-
4.0.0alpha2, 4.2.0
-
None
Description
As I needed to add a custom datatype very similar to ezobjectrelationlist, adding some custom informations, my idea was to have my datatype class inherited of eZObjectRelationListType, and then reimplementing only a few methods.
But this doesn't seem fully possible with the current datatype, as many static calls are made with a className::method() syntax. If you override such a called method, you will then need to re-implement multiple parent methods (the callers) in order to change the class name to fit everywhere it appears, and by cascade if the method is called elsewhere.
This is what happens if you re-implement, for an example, the method contentObjectArrayXMLMap().
Inheriting is then not that interesting as you reimplement almost evenrything..
The problem with the ezobjectrelationlist datatype is that a lot of the methods used statically aren't indeed marked as static and then shouldn't be used this way (or there's at least an inconsistency with documentation).
And just by changing non-static calls to instance calls, inheritance can be allowed very easily.
I attach a very simple patch against 4.0 alpha2 making the changes.
Currently used with an autoload as a temporary workaround, no problem found.
Attachments
Issue Links
- relates to
-
EZP-16757 EZP 4.3 Broken compatibility with DataImport Extension 1.5
- Closed