I've been fooling around with this module for five or six hours now and I can't figure out what the advanced option "unique" does.
I see that the documentation says
Unique: If this option is checked, no relations with the same end points as an existing relation (of the same type) will be allowed.
But my relationship type that is set as unique, merely prevents duplication of the exact same relationship. I must be misunderstanding - may I have an example use case for the unique option?
What I want is a relationship reaction on update. I think I'll have to use rules to achieve this. So like if I have a relationship
paris IS IN usa
and I create a relationship
paris IS IN france
The first relationship is destroyed; a city can only be in a single country. But if I create
bordeaux IS IN france
no relationship is impacted (provided bordeaux didn't already exist in a relation) because a country can contain many cities.
So my rule on-new-rel-creation:
- find the city of the relation
- if city exists, search any other relations with that particular city endpoint
- delete them
Comments