I am working on a site that allows students to enroll in classes. When they enroll in a class, I want to automatically add them to the class group. And if they cancel the enrollment, I want to automatically remove them.
I found this in the documentation
Groups_User_Group::create( array( 'user_id' => $user_id, 'group_id' => $group_id ) );
After digging in the source a little, I am guessing that this is the way to remove:
Groups_User_Group::delete ( $user_id, $group_id ) );