public function CourseObjectBook::createInstance in Course 8.2
Same name and namespace in other branches
- 8.3 modules/course_book/src/Plugin/course/CourseObject/CourseObjectBook.php \Drupal\course_book\Plugin\course\CourseObject\CourseObjectBook::createInstance()
- 3.x modules/course_book/src/Plugin/course/CourseObject/CourseObjectBook.php \Drupal\course_book\Plugin\course\CourseObject\CourseObjectBook::createInstance()
Make the book.
Overrides CourseObjectNode::createInstance
File
- modules/
course_book/ src/ Plugin/ course/ CourseObject/ CourseObjectBook.php, line 46
Class
- CourseObjectBook
- Plugin annotation @CourseObject( id = "book", label = "Book", handlers = { "fulfillment" = "\Drupal\course_book\Plugin\course\CourseObject\CourseObjectBookFulfillment" } )
Namespace
Drupal\course_book\Plugin\course\CourseObjectCode
public function createInstance($node = NULL) {
$node = \Drupal\node\Entity\Node::create([
'type' => $this
->getOption('node_type'),
]);
$node->book['bid'] = 'new';
parent::createInstance($node);
}