We have moved to GitHub Issues
Created by Vincent Baaij 15 May 2013, 08:25:49 Updated by Morten Christensen 22 May 2013, 09:53:24
In the 6.1 Beta the RelationService API is implemented. One of the available methods is GetAllRelations(params int ids)
Is it supposed to give you all relation for the supplied relation id's? If so, than its working as advertised :).
If it is supposed to give you all relations where the supplied id's are either the ParentId or ChildId (content item), then it's not working. I think it will be useful to have such a method as a supplement to the GetByChildId(id) and GetByParentId(id) methods
For a single content item it could be something like
Yeah, I can understand the confusion with the GetAllRelations method. Its actually for getting all relations and optional supply the ids of the relation itself. So not Child or Parent Id but the id of the relation.
If you want to get relations for a single content item you should use either: GetByParentId(id) - where id is the integer id of the content item. This returns relations where the content is the parent relation. OR GetByChildId(id) - where id is the integer id of the content item. This returns relations where the content is the child relation.
It's returning the relations for the supplied relation ids, so no problem there.
Have solved my problem by using GetByParent(id)
Don't you think the suggested function offers some value?
Just to make sure I understand it correct you want something like GetParentByIds(params int ids) and GetChildByIds(params int ids) ? Currently that would just be translated to a foreach to GetParentById/GetChildById because we don't have an optimized way of getting multiple entities by a property value. So we can easily add it, but it would not be optimized.
Nope, that's not what I meant. What I 'want' is a method you call with a content Id that gives you all the relations where the id occurs as a parent or a child
like the IsRelated method but instead of returning a bool it returns all relations for the supplied id
Okay, yes. Should be pretty simple to add.
Type: Feature (request)
Assignee: Morten Christensen
Backwards Compatible: True
Fix Submitted: Inline code
Affected versions: 6.1.0
Due in version: 6.1.0