Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-11716

Allow "objectrelationlist" datatype inheriting by using non static syntax for non static methods

    XMLWordPrintable

Details

    • Icon: Improvement Improvement
    • Resolution: Fixed
    • Icon: Medium Medium
    • 4.3.0alpha1
    • 4.0.0alpha2, 4.2.0
    • Misc
    • 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

        Activity

          People

            andre1 andre1
            alexandre.nion alexandre.nion
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: