ZF-8749: Add tag/method mapping, feed and item levels, in Zend_Feed_Reader
Creating an interface library between Zend_Feed_Reader (ZFR) and the in-house CMS which handles user configuration for outputting feeds in HTML (multiple feeds per page), I need to allow users to specify element names in the configuration file which should be extracted from feed and item levels for use in the output.
It would be preferable to let them choose from the generic getter method names created for ZFR (without the "get", for example "Authors" maps to "getAuthors()"), but this could be brittle if over time there are deletions/additions/renamings among feed and item level getter methods, within the ZFR classes. Besides, not all getters with "get" in their names map to XML elements; for instance "getDom" retrieves DOM stuff, not directly an element value/s.
As I love the generic getters that extract same elements across feed namespaces, I'd like guaranteed generic element names for cross-XML spec elements mapped to getter method names to be created in the feed object, perhaps as a property/ies that can be inspected and iterated. That way, ZFR getter methods could dynamically be called based on a list of generic element names set in the configuration.
The value of this to ZF is that ZFR presents an unretractable list of generic element names that can be added to but not subtracted from as an API feature, while allowing fluidity in how methods are structured within the ZFR classes. It might be a generalizable principle across other ZF components, as well, as it would increase backward-compatibility with ZF-based code should specs or code change.
In my opinion, Zend_Feed_Reader is a quantum leap forward -- just the right balance of versatility -- thank you!