Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[command] node:touch multivalue? #63

Open
dbu opened this issue May 4, 2013 · 4 comments
Open

[command] node:touch multivalue? #63

dbu opened this issue May 4, 2013 · 4 comments

Comments

@dbu
Copy link
Member

dbu commented May 4, 2013

i just noticed that the touch command does not support multivalue properties. we might try to clean that up. have a --prop-add argument?

btw, is it possible to just change a property of an existing node or do we have to create a new node for that?

@dantleech
Copy link
Member

In regard to modifying an existing node, yeah, touch will happily modify a node at the given path.

I wonder for prop-add if we can do some syntax like

--prop-set=foobar[]=bar
--prop-set=foobar["barfoo"]=foo

--prop-remove=foobar[0]
--prop-remove=foobar["barfoo"]

Actually - associative arrays are not supported in PHPCR-ODM .. right?

What would the syntax be for:

  • Adding an element to the end of the stack?: --prop-add=foobar=bar | --prop-set=foobar[]=bar
  • Replcaing an element at a specified index?: --prop-set=foobar[1]=bar
  • Removing an element at a specified index?: --prop-remove=foobar[1]

@dbu
Copy link
Member Author

dbu commented May 5, 2013

i like this [] syntax, looks reasonble. and i prefer it over prop-add. prop-add is confusing as you might think you need to know if the property already exists and have no indication it has to do with multivalue.

associative arrays are supported by the ODM layer, but not by PHPCR natively, so we can only have numeric keys here. even in the doctrine bundle, the commands to modify a PHPCR node should not support associative arrays. on phpcr level its just 2 separate arrays, one for keys and one for values.

@dbu
Copy link
Member Author

dbu commented Jun 7, 2013

re our irc discussion, i think we should not add more property things into touch, but rather have phpcr:property:* commands for that. touching a node while creating a property at the same time has some value, but for full flexibility i would go with a separate command.

@dbu
Copy link
Member Author

dbu commented Feb 9, 2015

@dantleech is this still relevant? i guess the phpcr-shell can handle this a lot better and we should remove the node:touch standalone commands in favor of the shell.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants