You are here

public static function CourseObjectTest::getMaxOccurences in Course 8.2

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

Return the number of occurances that can be in a course at the same time. For example, the design of the Certificate module can only have 1 set of mappings per node. The same goes for Course Credit. We may also want a course object that can only be added twice (for example, a before/after comparison).

This method is static because we might have to call it without an object being instantiated.

Overrides CourseObject::getMaxOccurences

File

modules/course_test/src/Plugin/course/CourseObject/CourseObjectTest.php, line 18

Class

CourseObjectTest
Plugin annotation @CourseObject( id = "course_test_object", label = "Test course object", handlers = { "fulfillment" = "\Drupal\course_test\Plugin\course\CourseObject\CourseObjectTestFulfillment" } )

Namespace

Drupal\course_test\Plugin\course\CourseObject

Code

public static function getMaxOccurences() {
  return 3;
}