Ticket #878 (closed task: fixed)

Opened 3 months ago

Last modified 3 months ago

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

Changed 3 months ago by david

  • status changed from new to closed
  • resolution set to fixed

(In [3001]) Changed singular/plural handling in AgaviXmlConfigDomElement? convenience methods, closes #878

Changed 3 months ago by felix

(In [3007]) Merged revisions 3001-3002,3005 via svnmerge from http://svn.agavi.org/branches/1.0

........

r3001 | david | 2008-10-08 20:28:51 +0200 (Wed, 08 Oct 2008) | 1 line

Changed singular/plural handling in AgaviXmlConfigDomElement? convenience methods, closes #878

........

r3002 | david | 2008-10-08 21:58:55 +0200 (Wed, 08 Oct 2008) | 1 line

Added getAttributes() and getAttributesNS() and cleaned up a bit (comments), refs #519

........

r3005 | felix | 2008-10-10 17:50:38 +0200 (Fri, 10 Oct 2008) | 3 lines

merges r3004 from http://svn.agavi.org/branches/dominik-validation-argument-sources fixes a minor typo in AgaviValidationManager::setError() and AgaviValidationManager::setError() that produced an error about a non declared variable and swallowed errors

........

Add/Change #878 (Change singular/plural handling in AgaviXmlConfigDomElement convenience methods)

Author



Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.