You are here

function CourseObjectContent::optionsDefinition in Course 8.2

Same name and namespace in other branches
  1. 8.3 modules/course_content/src/Plugin/course/CourseObject/CourseObjectContent.php \Drupal\course_content\Plugin\course\CourseObject\CourseObjectContent::optionsDefinition()
  2. 3.x modules/course_content/src/Plugin/course/CourseObject/CourseObjectContent.php \Drupal\course_content\Plugin\course\CourseObject\CourseObjectContent::optionsDefinition()

If course object is saved without configuration, make sure we have a default node type.

Overrides CourseObjectNode::optionsDefinition

File

modules/course_content/src/Plugin/course/CourseObject/CourseObjectContent.php, line 34

Class

CourseObjectContent
Plugin annotation @CourseObject( id = "content", label = "Course content", handlers = { "fulfillment" = "\Drupal\course_content\Course\Object\CourseObjectNodeFulfillment" } )

Namespace

Drupal\course_content\Plugin\course\CourseObject

Code

function optionsDefinition() {
  $options = parent::optionsDefinition();
  $options['node_type'] = $this
    ->getNodeTypes()[0];
  return $options;
}