You are here

public function CourseObjectWebform::create in Course 6

Creates a course object.

For example, this would create the new node and return the node ID if this was a CourseObjectNode.

Do not confuse this with save(), which saves the course outline record for tracking.

Course objects should call setInstanceId() if this is a course object that creates external resources.

Overrides CourseObjectNode::create

File

modules/course_webform/course_webform.classes.inc, line 8

Class

CourseObjectWebform
Parent class for webform course tracking.

Code

public function create() {
  $webform = new stdClass();
  $webform->type = 'webform';
  $webform->title = $this
    ->getTitle();
  $webform->uid = $this->user->uid;
  node_save($webform);
  $this
    ->setNode($webform);
}