You are here

public function CourseObjectNode::deleteInstance in Course 8.3

Same name and namespace in other branches
  1. 8.2 modules/course_content/src/Course/Object/CourseObjectNode.php \Drupal\course_content\Course\Object\CourseObjectNode::deleteInstance()
  2. 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\Object

Code

public function deleteInstance() {
  $node = \Drupal\node\Entity\Node::load($this
    ->getInstanceId());
  if ($node) {
    $node
      ->delete();
  }
}