You are here

function CourseObjectPoll::unEnroll in Course 6

Same name and namespace in other branches
  1. 7 modules/course_poll/course_poll.classes.inc \CourseObjectPoll::unEnroll()

Remove poll votes for this user.

Overrides CourseObject::unEnroll

File

modules/course_poll/course_poll.classes.inc, line 62

Class

CourseObjectPoll
Parent class for poll tracking.

Code

function unEnroll() {
  db_query('DELETE FROM {poll_votes} WHERE nid = %d AND uid = %d', $this->node->nid, $this
    ->getCourse()
    ->getUser()->uid);
  db_query("UPDATE {poll_choices} SET chvotes = chvotes - 1 WHERE nid = %d AND chorder = %d", $this->node->nid, $this->node->vote);
}