class CourseObjectPollFulfillment in Course 8.2
Same name and namespace in other branches
- 8.3 modules/course_poll/src/Course/Object/CourseObjectPollFulfillment.php \Drupal\course_poll\Course\Object\CourseObjectPollFulfillment
Hierarchy
- class \Drupal\course_poll\Course\Object\CourseObjectPollFulfillment extends \Drupal\course_poll\Course\Object\CourseObjectNodeFulfillment
Expanded class hierarchy of CourseObjectPollFulfillment
File
- modules/
course_poll/ src/ Course/ Object/ CourseObjectPollFulfillment.php, line 7
Namespace
Drupal\course_poll\Course\ObjectView source
class CourseObjectPollFulfillment extends CourseObjectNodeFulfillment {
/**
* Remove poll votes for this user.
*/
function delete() {
$account = Drupal\user\Entity\User::load($this->uid);
\Drupal::database()
->delete('poll_vote')
->condition('nid', $this
->getCourseObject()
->getInstanceId())
->condition('uid', $account->uid)
->execute();
db_update('poll_choice')
->expression('chvotes', 'chvotes - 1')
->condition('chid', $this
->getOption('instance'))
->execute();
parent::delete();
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CourseObjectPollFulfillment:: |
function | Remove poll votes for this user. |