Thank you. I mean I need to programmatically enroll a student on a specific course and put a user expiration on it. Is there a method or API that I can use on Opigno? Thanks again!
James Aparicio
Thu, 09/10/2015 - 11:17
Hi imat,
Hi imat,
Yes, if you have the opigno user expiration app installed then the memberships will have a user expiration field.
That function registers a user to a group and returns the membership it created. Group type is node and gid is the nid of the course, the entity is the user.
After that just set the membership expiration date and save the membership.
Hi imat,
Hi imat,
Ofc, http://www.drupalcontrib.org/api/drupal/contributions!og!og.module/function/og_group/7
Best regards
Thank you James,
Hi imat,
Hi imat,
Yes, if you have the opigno user expiration app installed then the memberships will have a user expiration field.
That function registers a user to a group and returns the membership it created. Group type is node and gid is the nid of the course, the entity is the user.
After that just set the membership expiration date and save the membership.
Something like:
$membership=og_group(...);
$membership->expirationdatefield="...";
og_membership_save($membership);
http://www.drupalcontrib.org/api/drupal/contributions%21og%21og.module/function/og_membership_save/7
Best regards
Thanks
Thanks