Added childrenAttributes and childrenAttributeKeys to allow for styling the UL menu element, following this update to KnpLabs/KnpMenu#31
Added properties and methods to allow use of childrenAttributes
I keep wondering if we should make hash maps a high level ODM feature. Or maybe at least look into making it possible to add this as a custom data type (http://www.doctrine-project.org/jira/browse/PHPCR-43)
Do we need to update KnpMenu and KnpMenuBundle in the sandbox to make this work?
@uwej711 children attributes are in KnpMenu since a long time. The recent change is that they are also used for the route node now instead of having a special case for it using attributes on the ul.
Yes, will need the versions in the sandbox updating as it is in response to a recent BC break. What would be the best way to do that? Just set up in a new sandbox install and manually test against a newer KnpMenu version?
and btw, I indeed find it weird to have to emulate hash maps in your documents. The ODM should support it (or even PHPCR).
JCR doesn't support hash maps, though maybe given that JCR defines an XML DB, maybe today it should also define a JSON store. But yeah, at the very least we could emulate it in PHPCR ODM.
@stof, @lsmith77: implementing hash maps could be done as in the ORM, serialize to a string. But maybe a child node would actually be more "JCR", $node->getPropertiesValues() actually returns a hash map ...
If all the menuItem objects need to investigate their children to be constructed - i.e. to collate any attributes etc - is that likely to have a performance penalty? Im completely new to Jackrabbit so no idea. Or maybe the entire menu tree has been queried already?
Yes there will be a performance penalty ... as far as I know we currently fetch nodes from the repository using the path and each time this might end up being a request to jackrabbit. Maybe the APIs used for querying (which I haven't used so far) allow for fetching more than a node at once (e.g. fetch a complete subtree or a subtree with a given depth or all ancestors). But this is getting off topic ... see http://www.doctrine-project.org/jira/browse/PHPCR-55
i think we should provide hashmaps in the odm and emulate them on phpcr for now. then we can talk with the jcr guys if this can be added to the next jcr version.
i created a ticket on phcpr-odm and invite you to discuss there
until thats done, does anybody want to update the sandbox and merge this pull request?
@uwej711 should we merge this as well now? any problem with it?
No problem with that but I haven't tried it myself.