You are here

public function CourseObjectBook::overrideOutlineListItem in Course 8.2

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

Overrides a course outline list item.

Overrides CourseObject::overrideOutlineListItem

File

modules/course_book/src/Plugin/course/CourseObject/CourseObjectBook.php, line 144

Class

CourseObjectBook
Plugin annotation @CourseObject( id = "book", label = "Book", handlers = { "fulfillment" = "\Drupal\course_book\Plugin\course\CourseObject\CourseObjectBookFulfillment" } )

Namespace

Drupal\course_book\Plugin\course\CourseObject

Code

public function overrideOutlineListItem(&$item) {

  // Check that course list outline handler is selected.
  if ($this
    ->getCourse()
    ->get('outline')
    ->getString() == 'course') {
    $type = $this
      ->getOption('outline_list_item_type');

    // Override the list item by reference.
    course_book_override_outline_list_item($item, $this, $type);
  }
}