Skip to content

[command] node:touch multivalue? #63

Open
@dbu

Description

@dbu
Member

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?

Activity

dantleech

dantleech commented on May 4, 2013

@dantleech
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

dbu commented on May 5, 2013

@dbu
MemberAuthor

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

dbu commented on Jun 7, 2013

@dbu
MemberAuthor

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

dbu commented on Feb 9, 2015

@dbu
MemberAuthor

@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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dbu@dantleech

        Issue actions

          [command] node:touch multivalue? · Issue #63 · phpcr/phpcr-utils