Ticket #878 (closed task: fixed)
Change singular/plural handling in AgaviXmlConfigDomElement convenience methods
| Reported by: | david | Owned by: | david |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.0 |
| Component: | config | Version: | 1.0.0beta1 |
| Severity: | major | Keywords: | |
| Cc: | Patch attached: | no |
Description
The automatic handling of <plurals> container elements with <plural> children is a bit random and incomplete at the moment. We should change it to behave like this (discussed on IRC):
- getChild() does no magic, returns exactly one child element of the given name if only exactly one child element of the given name exists
- hasChild() bool of the above
- getChildren() gets a third argument, defaulting to false, to switch on the singular/plural handling
- countChildren() and hasChildren() work the same way
- new get() and has() methods are shortcuts for calling getChildren() and hasChildren() with the third arg to true
Mind you we cannot use __get()/__isset() overloads for the plural magic as originally planned as the parent DOMElement and DOMNode classes define a couple of public properties already.
Attachments
Change History
Note: See
TracTickets for help on using
tickets.

