there is a function get_user_group_ids($user_id), it returns all groups the user belongs. this pings the batch table and gets all the batch_ids. ANd then pings group table and get group_ids corresponding to batch_ids
This is used in event, job and other libraries like eg , get all the job which belongs to my batch. here i need to call this function to get my group ids.
because this is a common function, i have doubt whether to create common library or model