$ 0 0 by Omar Esgaib. Maybe check "enrol_manual_enrol_users" function first, has more documentation and examples around, not sure if it suits your needs