You are here

function CourseObjectFulfillment::optionsDefinition in Course 8.3

Same name and namespace in other branches
  1. 8.2 src/Entity/CourseObjectFulfillment.php \Drupal\course\Entity\CourseObjectFulfillment::optionsDefinition()
  2. 3.x src/Entity/CourseObjectFulfillment.php \Drupal\course\Entity\CourseObjectFulfillment::optionsDefinition()

Allow arbitrary data to be stored on the fulfillment, without explicitly defining optionsDefinition() in a custom class.

It is suggested that modules provide their own fulfillment classes and specify the valid extra options through their own optionsDefinition(). See CourseObjectWebformFulfillment for an example of this.

Overrides CourseHandler::optionsDefinition

4 methods override CourseObjectFulfillment::optionsDefinition()
CourseObjectBookFulfillment::optionsDefinition in modules/course_book/src/Plugin/course/CourseObject/CourseObjectBookFulfillment.php
Define storage for book page views.
CourseObjectQuizFulfillment::optionsDefinition in modules/course_quiz/src/Plugin/course/CourseObject/CourseObjectQuizFulfillment.php
Define storage for quiz result IDs.
CourseObjectTestFulfillment::optionsDefinition in modules/course_test/src/Plugin/course/CourseObject/CourseObjectTestFulfillment.php
Define storage for fulfillment values.
CourseObjectWebformFulfillment::optionsDefinition in modules/course_webform/src/Plugin/course/CourseObject/CourseObjectWebformFulfillment.php
Define storage for submission IDs.

File

src/Entity/CourseObjectFulfillment.php, line 170

Class

CourseObjectFulfillment
Parent class for course object fulfillment. Unlike Course objects, this is not abstract and can be used when the fulfillment requirements are simple.

Namespace

Drupal\course\Entity

Code

function optionsDefinition() {
  return [];
}