It's not possible. The "conditions" parameter is not for the middle table. Which I believe is enough. Otherwise, it should not be a relationship. It works for read by an incident, not by design.
entityDefs link conditions
Collapse
X
-
entityDefs link conditions
Hi there!
I have custom Event type entity with many to many link with User entity. Here its link definition
It works perfectly fine for displaying info, but when I try to manipulate data of this link, I always get en error. I discovered, that when I open record view of an entity, it uses join user table, so condition works perfectly fine, but when I try to update data, no join user table is present in raw sql, so it fails. What should I change/add to negate the error?PHP Code:"attendees": { "type": "hasMany", "relationName": "cBusinessTripUser", "foreign": "cBusinessTrips", "entity": "User", "audited": false, "conditions": { "user.defaultTeamId!=": "665080eda8f96c718" }, "additionalColumns": { "status": { "type": "varchar", "len": "36", "default": "None" } }, "columnAttributeMap": { "status": "acceptanceStatus" } }
P.S. I know that I can add extra field defaultTeamId to middle table, but it will be db normalization, and defaultTeamId sometimes changes, so I will end up with inconsistent data. If there a way to add join every time this table is selected, it would be great solution!Tags: None

Leave a comment: