You are here

public static function CourseObjectBook::getNodeInstances 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::getNodeInstances()
  2. 3.x modules/course_book/src/Plugin/course/CourseObject/CourseObjectBook.php \Drupal\course_book\Plugin\course\CourseObject\CourseObjectBook::getNodeInstances()

Course node context handler callback.

Overrides CourseObjectNode::getNodeInstances

File

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

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 static function getNodeInstances($node) {
  if (!empty($node->book['bid'])) {
    return array(
      $node->book['bid'],
    );
  }
}