You are here

public function CourseObjectBook::freeze in Course 8.3

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

Override of CourseObjectNode::freeze().

Do not freeze the parent book ID.

course_book_node_insert() stumbles if this is set and we are cloning a book.

Overrides CourseObjectNode::freeze

File

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

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 freeze() {
  $ice = parent::freeze();
  unset($ice->node->book['bid']);
  return $ice;
}