Support master/detail joins using find_in_set

Post Reply
bkonia
User
Posts: 141

Support master/detail joins using find_in_set

Post by bkonia »

Now that PHPMaker supports multiple parents in User ID security, it would also make sense to support creating master/detail joins in which a detail record can have multiple parents. The find_in_set operator could be used to create a join on a field containing comma-separated values.This feature could be implemented easily and seamlessly. If the user creates a join between an integer field and a varchar field, PHPMaker could assume the varchar is a comma-separated list. In this instance, instead of using the = operator, it would use the find_in_set operator, when creating the join.

I have a specific use case for a messaging system, where each message has a sender ID and a receipient ID. When viewing a user as an admin, I want to be able to view all messages sent by AND received by the user. Currently, I'm accomplishing this with a cumbersome workaround that generates a custom filter in the Recordset_Selecting event. It would be much cleaner if I could simply join the user ID field in the parent record to the user_ids field in the detail record. This user_ids field would be a comma-separated list, containing the sender and recipient IDs for the message.


mobhar
User
Posts: 11660

Post by mobhar »

+1


ddiaz2380
User
Posts: 134

Post by ddiaz2380 »

+1


buhuhu
User
Posts: 203

Post by buhuhu »

+1


riverman
User
Posts: 158
Location: Stockholm/Sweden

Post by riverman »

+1


lamorte1977
User
Posts: 92

Post by lamorte1977 »

+1


stefano
User
Posts: 24

Post by stefano »

+1


Webmaster
User
Posts: 9425

Post by Webmaster »

Try v2023.


Post Reply