public function CourseObjectNode::deleteInstance in Course 8.2
Same name and namespace in other branches
- 8.3 modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::deleteInstance()
- 3.x modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::deleteInstance()
Destroy the node instance.
Overrides CourseObject::deleteInstance
File
- modules/
course_content/ src/ Course/ Object/ CourseObjectNode.php, line 136
Class
- CourseObjectNode
- A course object that uses a node as a base.
Namespace
Drupal\course_content\Course\ObjectCode
public function deleteInstance() {
$node = \Drupal\node\Entity\Node::load($this
->getInstanceId());
if ($node) {
$node
->delete();
}
}