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

How to add properties to relationships? #38

Open
babaganoush opened this issue Jun 28, 2013 · 8 comments
Open

How to add properties to relationships? #38

babaganoush opened this issue Jun 28, 2013 · 8 comments

Comments

@babaganoush
Copy link

Hello,

while we are able to create new nodes etc., we are still struggling to find out how properties can be added to existing relationships. For instance we are declaring the following in an Entity format:

/**
* @ogm\ManyToMany(relation="GOES_TO_MARKET")
*/
protected $shoppers;

How do we make it so that we can add additional properties to GOES_TO_MARKET using doctrine format?

Thanks

@lphuberdeau
Copy link
Owner

Since this was also posted on StackOverflow.

http://stackoverflow.com/questions/17364841/add-properties-to-relationships-in-a-neo4j-database-using-neo4j-ogm-in-php/17365248#17365248

I will leave the issue open as it relates to a feature request.

@babaganoush
Copy link
Author

yes thank you for answering the question on stack overflow by the way :)

I hope this feature gets implemented as that would really assist with adding properties to relationships in real time.

@babaganoush
Copy link
Author

Oh and this is an awesome bundle . Thanks for your hard work.

@ayhid
Copy link

ayhid commented Mar 17, 2014

According to the documentation we should be able to create Relations using the api
http://docs.neo4j.org/chunked/stable/rest-api-relationships.html#rest-api-create-relationship

@lphuberdeau
Copy link
Owner

Yes, relations are being created through that API. The issue is mostly about creating custom types of relationships, which the OGM has no mapping for at this time.

@ayhid
Copy link

ayhid commented Mar 17, 2014

I am just beginning to learn neo4j, so I don't know much about custom relationships sorry, but without going into these custom relationships, is it possible to just pass an extra argument which will be used as properties for the relationship? I am trying to figure out a way to implement this.

@lphuberdeau
Copy link
Owner

The link to the stackoverflow question above is still your best bet.

@ayhid
Copy link

ayhid commented Mar 17, 2014

okay thanks for the answer, I'll try to look more into the code to understand how it works.

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

3 participants