You are here

public function CourseObjectPoll::Xcreate in Course 8.3

Same name and namespace in other branches
  1. 8.2 modules/course_poll/src/Course/Object/CourseObjectPoll.php \Drupal\course_poll\Course\Object\CourseObjectPoll::Xcreate()

@todo broken D8

File

modules/course_poll/src/Course/Object/CourseObjectPoll.php, line 31

Class

CourseObjectPoll
Parent class for poll tracking.

Namespace

Drupal\course_poll\Course\Object

Code

public function Xcreate($node = NULL) {
  $poll = new stdClass();
  $poll->choice = array(
    array(
      'chtext' => 'Yes',
      'chvotes' => 0,
      'weight' => 0,
    ),
    array(
      'chtext' => 'No',
      'chvotes' => 0,
      'weight' => 0,
    ),
  );
  $poll->type = 'poll';
  $poll->active = 1;
  $poll->runtime = 0;
  parent::create($poll);
}